com.jclark.xsl.sax

Class ResultBase

public abstract class ResultBase extends Object implements Result, AttributeList

abstract base class represents the results of executing a stylesheet Action -- constructs result components. events are fired to the Result, which in turn fires events to a SAX (1) DocumentHandler
Field Summary
ErrorHandlererrorHandler
OutputMethodHandleroutputMethodHandler
Constructor Summary
ResultBase(OutputMethodHandler outputMethodHandler, ErrorHandler errorHandler)
Construct with an outputMethodHandler from which we'll obtain the appropriate DocumentHandler
ResultBase(DocumentHandler documentHandler, ErrorHandler errorHandler)
Construct with a DocummentHandler already determined
Method Summary
voidattribute(Name name, String value)
construct an Attribute with the given name ... if we're not at an appropriate point, eg, we've already started putting text into an element, do nothing
voidcharacters(String str)
construct some characters in the result
voidcomment(String str)
construct a comment in our result
voidend()
flush any pending construction work, nothing else will be built
voidendElement(Name elementType)
protected abstract voidendElementContent(Name elementType)
voidflush()
call this when we're sure we're not getting any more attribute node constructing actions
protected NamegetAttributeName(int i)
protected DocumentHandlergetDocumentHandler()
intgetLength()
StringgetType(int i)
StringgetType(String name)
StringgetValue(int i)
StringgetValue(String name)
static String[]grow(String[] v)
static Name[]grow(Name[] v)
voidmessage(Node node, String str)
voidprocessingInstruction(String target, String data)
construct a processingInstruction in the result
voidrawCharacters(String str)
rawCharacters are distinct from plain 'ol characters in that we don't try to do any escaping
abstract voidresultTreeFragment(ResultTreeFragment frag)
DocumentHandlersetOutputMethod(Name name, OutputMethod method)
get the appropriate DocumentHandler from the outputMethodHandler (we've already obtained for our destiantion) for the named output method
voidstart(OutputMethod outputMethod)
initialize, (and possibly construct) the DocumentHandler
voidstartElement(Name elementType, NamespacePrefixMap nsMap)
start construction an Element
protected abstract voidstartElementContent(Name elementType, NamespacePrefixMap nsMap)
we're finished with adding attributes?
protected voidthrowXSLException(SAXException e)

Field Detail

errorHandler

ErrorHandler errorHandler

outputMethodHandler

OutputMethodHandler outputMethodHandler

Constructor Detail

ResultBase

ResultBase(OutputMethodHandler outputMethodHandler, ErrorHandler errorHandler)
Construct with an outputMethodHandler from which we'll obtain the appropriate DocumentHandler

ResultBase

ResultBase(DocumentHandler documentHandler, ErrorHandler errorHandler)
Construct with a DocummentHandler already determined

Method Detail

attribute

public void attribute(Name name, String value)
construct an Attribute with the given name ... if we're not at an appropriate point, eg, we've already started putting text into an element, do nothing

characters

public void characters(String str)
construct some characters in the result

comment

public void comment(String str)
construct a comment in our result

end

public void end()
flush any pending construction work, nothing else will be built

endElement

public void endElement(Name elementType)

endElementContent

protected abstract void endElementContent(Name elementType)

flush

public void flush()
call this when we're sure we're not getting any more attribute node constructing actions

getAttributeName

protected final Name getAttributeName(int i)

Returns: the name of the i'th Attribute

getDocumentHandler

protected final DocumentHandler getDocumentHandler()

getLength

public int getLength()

Returns: the number of attribute nodes we have at this moment

getType

public String getType(int i)

Returns: the type of the i'th Attribute (always "CDATA")

getType

public String getType(String name)

Returns: the type of the named Attribute (always "CDATA")

getValue

public String getValue(int i)

Returns: the value of the i'th Attribute

getValue

public String getValue(String name)

Returns: the value of the named Attribute (always "CDATA") .. not sure how these names work with namespaces returns null if the named Attribute is not found

grow

static String[] grow(String[] v)

grow

static Name[] grow(Name[] v)

message

public void message(Node node, String str)

processingInstruction

public void processingInstruction(String target, String data)
construct a processingInstruction in the result

rawCharacters

public void rawCharacters(String str)
rawCharacters are distinct from plain 'ol characters in that we don't try to do any escaping

resultTreeFragment

public abstract void resultTreeFragment(ResultTreeFragment frag)

setOutputMethod

DocumentHandler setOutputMethod(Name name, OutputMethod method)
get the appropriate DocumentHandler from the outputMethodHandler (we've already obtained for our destiantion) for the named output method

start

public void start(OutputMethod outputMethod)
initialize, (and possibly construct) the DocumentHandler

startElement

public void startElement(Name elementType, NamespacePrefixMap nsMap)
start construction an Element

startElementContent

protected abstract void startElementContent(Name elementType, NamespacePrefixMap nsMap)
we're finished with adding attributes?

throwXSLException

protected void throwXSLException(SAXException e)