org.apache.xml.serializer

Class ToXMLSAXHandler

public final class ToXMLSAXHandler extends ToSAXHandler

This class receives notification of SAX-like events, and with gathered information over these calls it will invoke the equivalent SAX methods on a handler, the ultimate xsl:output method is known to be "xml". This class is not a public API, it is only public because it is used by Xalan.

UNKNOWN: internal

Constructor Summary
ToXMLSAXHandler()
ToXMLSAXHandler(ContentHandler handler, String encoding)
ToXMLSAXHandler(ContentHandler handler, LexicalHandler lex, String encoding)
Method Summary
voidaddAttribute(String uri, String localName, String rawName, String type, String value, boolean XSLAttribute)
Adds the given attribute to the set of attributes, and also makes sure that the needed prefix/uri mapping is declared, but only if there is a currently open element.
voidattributeDecl(String arg0, String arg1, String arg2, String arg3, String arg4)
voidcharacters(String chars)
voidcharacters(char[] ch, int off, int len)
voidcloseCDATA()
Closes ane open cdata tag, and unlike the this.endCDATA() method (from the LexicalHandler) interface, this "internal" method will send the endCDATA() call to the wrapped handler.
voidcomment(char[] arg0, int arg1, int arg2)
voidelementDecl(String arg0, String arg1)
voidendCDATA()
voidendDocument()
Receives notification of the end of the document.
voidendDTD()
voidendElement(String namespaceURI, String localName, String qName)
voidendElement(String elemName)
voidendPrefixMapping(String prefix)
voidexternalEntityDecl(String arg0, String arg1, String arg2)
PropertiesgetOutputFormat()
OutputStreamgetOutputStream()
WritergetWriter()
voidignorableWhitespace(char[] arg0, int arg1, int arg2)
voidindent(int n)
Do nothing for SAX.
voidinternalEntityDecl(String arg0, String arg1)
voidnamespaceAfterStartElement(String prefix, String uri)
Send a namespace declaration in the output document.
voidprocessingInstruction(String target, String data)
booleanreset()
Try's to reset the super class and reset this class for re-use, so that you don't need to create a new serializer (mostly for performance reasons).
voidserialize(Node node)
voidsetDocumentLocator(Locator arg0)
booleansetEscaping(boolean escape)
voidsetOutputFormat(Properties format)
voidsetOutputStream(OutputStream output)
voidsetWriter(Writer writer)
voidskippedEntity(String arg0)
voidstartCDATA()
voidstartElement(String elementNamespaceURI, String elementLocalName, String elementName)
Start an element in the output document.
voidstartElement(String elementName)
voidstartElement(String namespaceURI, String localName, String name, Attributes atts)
voidstartEntity(String arg0)
voidstartPrefixMapping(String prefix, String uri)
booleanstartPrefixMapping(String prefix, String uri, boolean shouldFlush)
Remember the prefix/uri mapping at the current nested element depth.

Constructor Detail

ToXMLSAXHandler

public ToXMLSAXHandler()

ToXMLSAXHandler

public ToXMLSAXHandler(ContentHandler handler, String encoding)

ToXMLSAXHandler

public ToXMLSAXHandler(ContentHandler handler, LexicalHandler lex, String encoding)

Method Detail

addAttribute

public void addAttribute(String uri, String localName, String rawName, String type, String value, boolean XSLAttribute)
Adds the given attribute to the set of attributes, and also makes sure that the needed prefix/uri mapping is declared, but only if there is a currently open element.

Parameters: uri the URI of the attribute localName the local name of the attribute rawName the qualified name of the attribute type the type of the attribute (probably CDATA) value the value of the attribute XSLAttribute true if this attribute is coming from an xsl:attribute element

See Also: ExtendedContentHandler

attributeDecl

public void attributeDecl(String arg0, String arg1, String arg2, String arg3, String arg4)

See Also: org.xml.sax.ext.DeclHandler#attributeDecl(String, String, String, String, String)

characters

public void characters(String chars)

See Also: characters

characters

public void characters(char[] ch, int off, int len)

closeCDATA

public void closeCDATA()
Closes ane open cdata tag, and unlike the this.endCDATA() method (from the LexicalHandler) interface, this "internal" method will send the endCDATA() call to the wrapped handler.

comment

public void comment(char[] arg0, int arg1, int arg2)

See Also: org.xml.sax.ext.LexicalHandler#comment(char[], int, int)

elementDecl

public void elementDecl(String arg0, String arg1)

See Also: org.xml.sax.ext.DeclHandler#elementDecl(String, String)

endCDATA

public void endCDATA()

See Also: org.xml.sax.ext.LexicalHandler#endCDATA()

endDocument

public void endDocument()
Receives notification of the end of the document.

See Also: org.xml.sax.ContentHandler#endDocument()

endDTD

public void endDTD()

See Also: org.xml.sax.ext.LexicalHandler#endDTD()

endElement

public void endElement(String namespaceURI, String localName, String qName)

See Also: org.xml.sax.ContentHandler#endElement(String, String, String)

endElement

public void endElement(String elemName)

See Also: endElement

endPrefixMapping

public void endPrefixMapping(String prefix)

See Also: org.xml.sax.ContentHandler#endPrefixMapping(String)

externalEntityDecl

public void externalEntityDecl(String arg0, String arg1, String arg2)

See Also: org.xml.sax.ext.DeclHandler#externalEntityDecl(String, String, String)

getOutputFormat

public Properties getOutputFormat()

See Also: getOutputFormat

getOutputStream

public OutputStream getOutputStream()

See Also: getOutputStream

getWriter

public Writer getWriter()

See Also: getWriter

ignorableWhitespace

public void ignorableWhitespace(char[] arg0, int arg1, int arg2)

See Also: org.xml.sax.ContentHandler#ignorableWhitespace(char[], int, int)

indent

public void indent(int n)
Do nothing for SAX.

internalEntityDecl

public void internalEntityDecl(String arg0, String arg1)

See Also: org.xml.sax.ext.DeclHandler#internalEntityDecl(String, String)

namespaceAfterStartElement

public void namespaceAfterStartElement(String prefix, String uri)
Send a namespace declaration in the output document. The namespace declaration will not be include if the namespace is already in scope with the same prefix.

processingInstruction

public void processingInstruction(String target, String data)

See Also: org.xml.sax.ContentHandler#processingInstruction(String, String) Send a processing instruction to the output document

reset

public boolean reset()
Try's to reset the super class and reset this class for re-use, so that you don't need to create a new serializer (mostly for performance reasons).

Returns: true if the class was successfuly reset.

See Also: reset

serialize

public void serialize(Node node)

See Also: serialize

setDocumentLocator

public void setDocumentLocator(Locator arg0)

See Also: org.xml.sax.ContentHandler#setDocumentLocator(Locator)

setEscaping

public boolean setEscaping(boolean escape)

See Also: SerializationHandler

setOutputFormat

public void setOutputFormat(Properties format)

See Also: setOutputFormat

setOutputStream

public void setOutputStream(OutputStream output)

See Also: setOutputStream

setWriter

public void setWriter(Writer writer)

See Also: setWriter

skippedEntity

public void skippedEntity(String arg0)

See Also: org.xml.sax.ContentHandler#skippedEntity(String)

startCDATA

public void startCDATA()

startElement

public void startElement(String elementNamespaceURI, String elementLocalName, String elementName)
Start an element in the output document. This might be an XML element (data type) or a CDATA section.

startElement

public void startElement(String elementName)

startElement

public void startElement(String namespaceURI, String localName, String name, Attributes atts)

See Also: org.xml.sax.ContentHandler#startElement(String, String, String, Attributes)

startEntity

public void startEntity(String arg0)

See Also: org.xml.sax.ext.LexicalHandler#startEntity(String)

startPrefixMapping

public void startPrefixMapping(String prefix, String uri)

Parameters: prefix The prefix that maps to the URI uri The URI for the namespace

See Also: org.xml.sax.ContentHandler#startPrefixMapping(String, String)

startPrefixMapping

public boolean startPrefixMapping(String prefix, String uri, boolean shouldFlush)
Remember the prefix/uri mapping at the current nested element depth.

Parameters: prefix The prefix that maps to the URI uri The URI for the namespace shouldFlush a flag indicating if the mapping applies to the current element or an up coming child (not used).

See Also: org.xml.sax.ContentHandler#startPrefixMapping(String, String)

Copyright B) 2005 Apache XML Project. All Rights Reserved.