org.apache.xml.serializer
Class ToXMLStream
- org.xml.sax.ContentHandler, DeclHandler, org.xml.sax.DTDHandler, ErrorHandler, DOMSerializer, org.apache.xml.serializer.ExtendedContentHandler, org.apache.xml.serializer.ExtendedLexicalHandler, org.xml.sax.ext.LexicalHandler, SerializationHandler, Serializer, org.apache.xml.serializer.SerializerConstants, org.apache.xml.serializer.XSLOutputAttributes
public final class ToXMLStream
This class converts SAX or SAX-like calls to a
serialized xml document. The xsl:output method is "xml".
This class is used explicitly in code generated by XSLTC,
so it is "public", but it should
be viewed as internal or package private, this is not an API.
CDATA_CONTINUE , CDATA_DELIMITER_CLOSE , CDATA_DELIMITER_OPEN , DEFAULT_SAX_SERIALIZER , EMPTYSTRING , ENTITY_AMP , ENTITY_CRLF , ENTITY_GT , ENTITY_LT , ENTITY_QUOT , XMLNS_PREFIX , XMLNS_URI , XMLVERSION10 , XMLVERSION11 , XML_PREFIX |
void | CopyFrom(ToXMLStream xmlListener) - Copy properties from another SerializerToXML.
|
void | addAttribute(String uri, String localName, String rawName, String type, String value, boolean xslAttribute) - Add an attribute to the current element.
|
void | addUniqueAttribute(String name, String value, int flags) - This method is used to add an attribute to the currently open element.
|
void | endDocument() - Receive notification of the end of a document.
|
void | endElement(String elemName)
|
void | endPreserving() - Ends a whitespace preserving section.
|
void | entityReference(String name) - Receive notivication of a entityReference.
|
void | namespaceAfterStartElement(String prefix, String uri) - This method is used to notify the serializer of a namespace mapping (or node)
that applies to the current element whose startElement() call has already been seen.
|
void | processingInstruction(String target, String data) - Receive notification of a processing instruction.
|
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).
|
void | startDocumentInternal() - Receive notification of the beginning of a document.
|
void | startPreserving() - Starts a whitespace preserving section.
|
addAttributeAlways , attributeDecl , characters , characters , comment , elementDecl , endCDATA , endDTD , endElement , endElement , endNonEscaping , endPrefixMapping , externalEntityDecl , flushPending , getIndentAmount , getOutputFormat , getOutputStream , getWriter , ignorableWhitespace , internalEntityDecl , notationDecl , processAttributes , reset , serialize , setCdataSectionElements , setContentHandler , setDTDEntityExpansion , setEncoding , setEscaping , setIndentAmount , setLineSepUse , setOutputFormat , setOutputStream , setTransformer , setWriter , skippedEntity , startCDATA , startDTD , startElement , startElement , startElement , startEntity , startNonEscaping , startPrefixMapping , startPrefixMapping , unparsedEntityDecl , writeAttrString |
addAttribute , addAttribute , addAttribute , addAttributeAlways , addAttributes , addXSLAttribute , asContentHandler , asDOMSerializer , characters , close , comment , endEntity , entityReference , error , fatalError , fireEndEntity , getDoctypePublic , getDoctypeSystem , getEncoding , getIndent , getIndentAmount , getMediaType , getNamespaceMappings , getNamespaceURI , getNamespaceURIFromPrefix , getOmitXMLDeclaration , getPrefix , getStandalone , getTransformer , getVersion , namespaceAfterStartElement , notationDecl , reset , setDTDEntityExpansion , setDoctype , setDoctypePublic , setDoctypeSystem , setDocumentLocator , setEncoding , setIndent , setIndentAmount , setMediaType , setNamespaceMappings , setOmitXMLDeclaration , setSourceLocator , setStandalone , setTransformer , setVersion , startDocument , unparsedEntityDecl , warning |
ToXMLStream
public ToXMLStream()
Default constructor.
CopyFrom
public void CopyFrom(ToXMLStream xmlListener)
Copy properties from another SerializerToXML.
xmlListener
- non-null reference to a SerializerToXML object.
addAttribute
public void addAttribute(String uri,
String localName,
String rawName,
String type,
String value,
boolean xslAttribute)
throws SAXException
Add an attribute to the current element.
- addAttribute in interface org.apache.xml.serializer.ExtendedContentHandler
- addAttribute in interface SerializerBase
uri
- the URI associated with the element namelocalName
- local part of the attribute namerawName
- prefix:localNametype
- value
- the value of the attributexslAttribute
- true if this attribute is from an xsl:attribute,
false if declared within the elements opening tag.
addUniqueAttribute
public void addUniqueAttribute(String name,
String value,
int flags)
throws SAXException
This method is used to add an attribute to the currently open element.
The caller has guaranted that this attribute is unique, which means that it
not been seen before and will not be seen again.
- addUniqueAttribute in interface org.apache.xml.serializer.ExtendedContentHandler
name
- the qualified name of the attributevalue
- the value of the attribute which can contain only
ASCII printable characters characters in the range 32 to 127 inclusive.flags
- the bit values of this integer give optimization information.
endDocument
public void endDocument()
throws SAXException
Receive notification of the end of a document.
endElement
public void endElement(String elemName)
throws SAXException
- endElement in interface org.apache.xml.serializer.ExtendedContentHandler
- endElement in interface ToStream
ExtendedContentHandler.endElement(String)
endPreserving
public void endPreserving()
throws SAXException
Ends a whitespace preserving section.
entityReference
public void entityReference(String name)
throws SAXException
Receive notivication of a entityReference.
- entityReference in interface org.apache.xml.serializer.ExtendedContentHandler
- entityReference in interface SerializerBase
name
- The name of the entity.
namespaceAfterStartElement
public void namespaceAfterStartElement(String prefix,
String uri)
throws SAXException
This method is used to notify the serializer of a namespace mapping (or node)
that applies to the current element whose startElement() call has already been seen.
The official SAX startPrefixMapping(prefix,uri) is to define a mapping for a child
element that is soon to be seen with a startElement() call. The official SAX call
does not apply to the current element, hence the reason for this method.
- namespaceAfterStartElement in interface org.apache.xml.serializer.ExtendedContentHandler
- namespaceAfterStartElement in interface SerializerBase
processingInstruction
public void processingInstruction(String target,
String data)
throws SAXException
Receive notification of a processing instruction.
target
- The processing instruction target.data
- The processing instruction data, or null if
none was supplied.
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).
- reset in interface Serializer
- reset in interface ToStream
- true if the class was successfuly reset.
startDocumentInternal
public void startDocumentInternal()
throws SAXException
Receive notification of the beginning of a document.
startPreserving
public void startPreserving()
throws SAXException
Starts a whitespace preserving section. All characters printed
within a preserving section are printed without indentation and
without consolidating multiple spaces. This is equivalent to
the
xml:space="preserve" attribute. Only XML
and HTML serializers need to support this method.
The contents of the whitespace preserving section will be delivered
through the regular
characters event.
Copyright B) 2005 Apache XML Project. All Rights Reserved.