com.jclark.xsl.sax2

Class ResultBase

public abstract class ResultBase extends Object implements Result, Attributes

abstract base class represents the results of executing a stylesheet Action -- constructs result components. events are fired to the Result, which may, in turn, fire events to a SAX ContHandler
Field Summary
ErrorHandler_errorHandler
OutputMethodHandler_outputMethodHandler
Constructor Summary
ResultBase(OutputMethodHandler outputMethodHandler, ErrorHandler errorHandler)
Construct with an outputMethodHandler from which we'll obtain the appropriate ContentHandler
ResultBase(ContentHandler contentHandler, ErrorHandler errorHandler)
Construct with a ContentHandler 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)
Notify the Element is ending
voidflush()
call this when we're sure we're not getting any more attribute node constructing actions
protected NamegetAttributeName(int index)
protected ContentHandlergetContentHandler()
intgetIndex(String qName)
intgetIndex(String namespaceURI, String localName)
Attributes implementation: get the index of the Attribute with the given Name components, or -1 if it does not exist
intgetLength()
StringgetLocalName(int index)
Attributes implementation: get the Attribute's local name
StringgetQName(int index)
StringgetType(int index)
StringgetType(String qName)
StringgetType(String namespaceURI, String localName)
StringgetURI(int index)
Attributes implementation: get the namespace for the i'th Attribute's name
StringgetValue(String namespaceURI, String localName)
Attributes implementation: get the value of the Attribute with the given name in the given namespace the String value of the Attribute, or null if it does not exist
StringgetValue(int index)
Attributes implementation: get the value of the i'th Attribute
StringgetValue(String qName)
Attributes implementation: get the value of the named Attribute
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)
Copy a Result Tree Fragment to the Destination via the Handler
ContentHandlersetOutputMethod(Name name, OutputMethod method)
get the appropriate ContentHandler from the outputMethodHandler (we've already obtained for our destination) for the named output method
voidstart(OutputMethod outputMethod)
initialize, (and possibly construct) the ContentHandler called by the transformation engine
voidstartElement(Name elementType, NamespacePrefixMap nsMap)
start construction an Element ... we may yet get some attributes, so we'll wait a bit before propagating the event downstream
protected abstract voidstartElementContent(Name elementType, NamespacePrefixMap nsMap)
notify that 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 ContentHandler

ResultBase

ResultBase(ContentHandler contentHandler, ErrorHandler errorHandler)
Construct with a ContentHandler 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)
Notify the Element is ending

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 index)

Returns: the name of the i'th Attribute

getContentHandler

protected final ContentHandler getContentHandler()

getIndex

public int getIndex(String qName)

getIndex

public int getIndex(String namespaceURI, String localName)
Attributes implementation: get the index of the Attribute with the given Name components, or -1 if it does not exist

getLength

public int getLength()

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

getLocalName

public String getLocalName(int index)
Attributes implementation: get the Attribute's local name

getQName

public String getQName(int index)

getType

public String getType(int index)

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

getType

public String getType(String qName)

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

getType

public String getType(String namespaceURI, String localName)

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

getURI

public String getURI(int index)
Attributes implementation: get the namespace for the i'th Attribute's name

getValue

public String getValue(String namespaceURI, String localName)
Attributes implementation: get the value of the Attribute with the given name in the given namespace the String value of the Attribute, or null if it does not exist

getValue

public String getValue(int index)
Attributes implementation: get the value of the i'th Attribute

getValue

public String getValue(String qName)
Attributes implementation: get the value of the named Attribute

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)
Copy a Result Tree Fragment to the Destination via the Handler

setOutputMethod

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

start

public void start(OutputMethod outputMethod)
initialize, (and possibly construct) the ContentHandler called by the transformation engine

Parameters: outputMethod the xsl:output parameters gleaned from the stylesheet

startElement

public void startElement(Name elementType, NamespacePrefixMap nsMap)
start construction an Element ... we may yet get some attributes, so we'll wait a bit before propagating the event downstream

startElementContent

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

throwXSLException

protected void throwXSLException(SAXException e)