org.apache.xml.serializer
Class EmptySerializer

java.lang.Object
  extended by org.apache.xml.serializer.EmptySerializer
All Implemented Interfaces:
DOMSerializer, ExtendedContentHandler, ExtendedLexicalHandler, SerializationHandler, Serializer, XSLOutputAttributes, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.ErrorHandler, org.xml.sax.ext.DeclHandler, org.xml.sax.ext.LexicalHandler
Direct Known Subclasses:
SimpleResultTreeImpl, StringValueHandler

public class EmptySerializer
extends java.lang.Object
implements SerializationHandler

This class is an adapter class. Its only purpose is to be extended and for that extended class to over-ride all methods that are to be used. This class is not a public API, it is only public because it is used across package boundaries.


Field Summary
protected static java.lang.String ERR
           
 
Fields inherited from interface org.apache.xml.serializer.ExtendedContentHandler
HTML_ATTREMPTY, HTML_ATTRURL, NO_BAD_CHARS
 
Constructor Summary
EmptySerializer()
           
 
Method Summary
 void addAttribute(java.lang.String name, java.lang.String value)
          Add an attribute to the current element.
 void addAttribute(java.lang.String uri, java.lang.String localName, java.lang.String rawName, java.lang.String type, java.lang.String value)
          Add at attribute to the current element, not from an xsl:attribute element.
 void addAttribute(java.lang.String uri, java.lang.String localName, java.lang.String rawName, java.lang.String type, java.lang.String value, boolean XSLAttribute)
          Add at attribute to the current element
 void addAttributes(org.xml.sax.Attributes atts)
          Add attributes to the current element
 void addUniqueAttribute(java.lang.String name, java.lang.String value, int flags)
          Add a unique attribute to the current element.
 void addXSLAttribute(java.lang.String qName, java.lang.String value, java.lang.String uri)
          Add an attribute from an xsl:attribute element.
(package private)  void aMethodIsCalled()
           
 org.xml.sax.ContentHandler asContentHandler()
          Return a ContentHandler interface to provide SAX input to.
 java.lang.Object asDOM3Serializer()
          Return an Object into this serializer to be cast to a DOM3Serializer.
 DOMSerializer asDOMSerializer()
          Return a DOMSerializer interface into this serializer.
 void attributeDecl(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3, java.lang.String arg4)
           
 void characters(char[] arg0, int arg1, int arg2)
           
 void characters(org.w3c.dom.Node node)
          This method is used to notify of a character event, but passing the data as a DOM Node rather than the standard character array.
 void characters(java.lang.String chars)
          This method is used to notify of a character event, but passing the data as a character String rather than the standard character array.
 void close()
           
 void comment(char[] arg0, int arg1, int arg2)
           
 void comment(java.lang.String comment)
          This method is used to notify of a comment
protected  void couldThrowException()
           
protected  void couldThrowIOException()
           
protected  void couldThrowSAXException()
           
protected  void couldThrowSAXException(char[] chars, int off, int len)
           
protected  void couldThrowSAXException(java.lang.String elemQName)
           
 void elementDecl(java.lang.String arg0, java.lang.String arg1)
           
 void endCDATA()
           
 void endDocument()
           
 void endDTD()
           
 void endElement(java.lang.String elemName)
          This method is used to notify that an element has ended.
 void endElement(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2)
           
 void endEntity(java.lang.String arg0)
           
 void endPrefixMapping(java.lang.String arg0)
           
 void entityReference(java.lang.String entityName)
          Notify of an entity reference.
 void error(org.xml.sax.SAXParseException arg0)
           
 void externalEntityDecl(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2)
           
 void fatalError(org.xml.sax.SAXParseException arg0)
           
 void flushPending()
          A SerializationHandler accepts SAX-like events, so it can accumulate attributes or namespace nodes after a startElement().
 java.lang.String getDoctypePublic()
          Returns the previously set value of the value to be used as the public identifier in the document type declaration (DTD).
 java.lang.String getDoctypeSystem()
          Returns the previously set value of the value to be used as the system identifier in the document type declaration (DTD).
 java.lang.String getEncoding()
           
 boolean getIndent()
           
 int getIndentAmount()
           
 java.lang.String getMediaType()
           
 NamespaceMappings getNamespaceMappings()
          This method returns an object that has the current namespace mappings in effect.
 java.lang.String getNamespaceURI(java.lang.String name, boolean isElement)
          This method gets the prefix associated with a current element or attribute name.
 java.lang.String getNamespaceURIFromPrefix(java.lang.String prefix)
          This method returns the namespace URI currently associated with the prefix.
 boolean getOmitXMLDeclaration()
           
 java.util.Properties getOutputFormat()
          Returns the output format properties for this serializer.
 java.lang.String getOutputProperty(java.lang.String name)
          Get the value for a property that affects seraialization, if a property was set return that value, otherwise return the default value, otherwise return null.
 java.lang.String getOutputPropertyDefault(java.lang.String name)
          Get the default value for a property that affects seraialization, or null if there is none.
 java.io.OutputStream getOutputStream()
          Get the output stream where the events will be serialized to.
 java.lang.String getPrefix(java.lang.String uri)
          This method returns the prefix that currently maps to the given namespace URI.
 java.lang.String getStandalone()
           
 javax.xml.transform.Transformer getTransformer()
          Get the transformer associated with the serializer.
 java.lang.String getVersion()
           
 java.io.Writer getWriter()
          Get the character stream where the events will be serialized to.
 void ignorableWhitespace(char[] arg0, int arg1, int arg2)
           
 void internalEntityDecl(java.lang.String arg0, java.lang.String arg1)
           
 void namespaceAfterStartElement(java.lang.String uri, java.lang.String prefix)
          This method is used to notify that a prefix mapping is to start, but after an element is started.
 void notationDecl(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2)
           
 void processingInstruction(java.lang.String arg0, java.lang.String arg1)
           
 boolean reset()
          This method resets the serializer.
 void serialize(org.w3c.dom.Node node)
          Serializes the DOM node.
 void setCdataSectionElements(java.util.Hashtable h)
           
 void setCdataSectionElements(java.util.Vector URI_and_localNames)
          Sets the value coming from the xsl:output cdata-section-elements stylesheet property.
 void setContentHandler(org.xml.sax.ContentHandler ch)
          Set the SAX Content handler that the serializer sends its output to.
 void setDoctype(java.lang.String system, java.lang.String pub)
          Set the value coming from the xsl:output doctype-public and doctype-system stylesheet properties
 void setDoctypePublic(java.lang.String doctype)
          Set the value coming from the xsl:output doctype-public stylesheet attribute.
 void setDoctypeSystem(java.lang.String doctype)
          Set the value coming from the xsl:output doctype-system stylesheet attribute.
 void setDocumentLocator(org.xml.sax.Locator arg0)
           
 void setDTDEntityExpansion(boolean expand)
          Default behavior is to expand DTD entities, that is the initall default value is true.
 void setEncoding(java.lang.String encoding)
          Sets the character encoding coming from the xsl:output encoding stylesheet attribute.
 boolean setEscaping(boolean escape)
          Turns special character escaping on/off.
 void setIndent(boolean indent)
          Sets the value coming from the xsl:output indent stylesheet attribute.
 void setIndentAmount(int spaces)
          Set the number of spaces to indent for each indentation level.
 void setMediaType(java.lang.String mediatype)
          Sets the value coming from the xsl:output media-type stylesheet attribute.
 void setNamespaceMappings(NamespaceMappings mappings)
          Used only by TransformerSnapshotImpl to restore the serialization to a previous state.
 void setOmitXMLDeclaration(boolean b)
          Sets the value coming from the xsl:output omit-xml-declaration stylesheet attribute
 void setOutputFormat(java.util.Properties format)
          Specifies an output format for this serializer.
 void setOutputProperty(java.lang.String name, java.lang.String val)
          Set the non-default value for a property that affects seraialization.
 void setOutputPropertyDefault(java.lang.String name, java.lang.String val)
          Set the default value for a property that affects seraialization.
 void setOutputStream(java.io.OutputStream output)
          Specifies an output stream to which the document should be serialized.
 void setSourceLocator(javax.xml.transform.SourceLocator locator)
          This method is used to set the source locator, which might be used to generated an error message.
 void setStandalone(java.lang.String standalone)
          Sets the value coming from the xsl:output standalone stylesheet attribute.
 void setTransformer(javax.xml.transform.Transformer transformer)
          Set the transformer associated with the serializer.
 void setVersion(java.lang.String version)
          Sets the value coming from the xsl:output version attribute.
 void setWriter(java.io.Writer writer)
          Specifies a writer to which the document should be serialized.
 void skippedEntity(java.lang.String arg0)
           
 void startCDATA()
           
 void startDocument()
           
 void startDTD(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2)
           
 void startElement(java.lang.String qName)
          This method is used to notify of the start of an element
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
          This method is used to notify that an element is starting.
 void startElement(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, org.xml.sax.Attributes arg3)
           
 void startEntity(java.lang.String arg0)
           
 void startPrefixMapping(java.lang.String arg0, java.lang.String arg1)
           
 boolean startPrefixMapping(java.lang.String prefix, java.lang.String uri, boolean shouldFlush)
          This method is used to notify that a prefix maping is to start, which can be for the current element, or for the one to come.
 void unparsedEntityDecl(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3)
           
 void warning(org.xml.sax.SAXParseException arg0)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERR

protected static final java.lang.String ERR
See Also:
Constant Field Values
Constructor Detail

EmptySerializer

public EmptySerializer()
Method Detail

couldThrowIOException

protected void couldThrowIOException()
                              throws java.io.IOException
Throws:
java.io.IOException
See Also:
Serializer.asContentHandler()

couldThrowSAXException

protected void couldThrowSAXException()
                               throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

couldThrowSAXException

protected void couldThrowSAXException(char[] chars,
                                      int off,
                                      int len)
                               throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

couldThrowSAXException

protected void couldThrowSAXException(java.lang.String elemQName)
                               throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

couldThrowException

protected void couldThrowException()
                            throws java.lang.Exception
Throws:
java.lang.Exception

aMethodIsCalled

void aMethodIsCalled()

asContentHandler

public org.xml.sax.ContentHandler asContentHandler()
                                            throws java.io.IOException
Description copied from interface: Serializer
Return a ContentHandler interface to provide SAX input to. Through the returned object the document to be serailized, as a series of SAX events, can be provided to the serialzier. If the serializer does not support the ContentHandler interface, it will return null.

In principle only one of asDOMSerializer() or asContentHander() should be called.

Specified by:
asContentHandler in interface Serializer
Returns:
A ContentHandler interface into this serializer, or null if the serializer is not SAX 2 capable
Throws:
java.io.IOException - An I/O exception occured
See Also:
Serializer.asContentHandler()

setContentHandler

public void setContentHandler(org.xml.sax.ContentHandler ch)
Description copied from interface: SerializationHandler
Set the SAX Content handler that the serializer sends its output to. This method only applies to a ToSAXHandler, not to a ToStream serializer.

Specified by:
setContentHandler in interface SerializationHandler
See Also:
SerializationHandler.setContentHandler(org.xml.sax.ContentHandler)

close

public void close()
Specified by:
close in interface SerializationHandler
See Also:
SerializationHandler.close()

getOutputFormat

public java.util.Properties getOutputFormat()
Description copied from interface: Serializer
Returns the output format properties for this serializer.

Specified by:
getOutputFormat in interface Serializer
Returns:
The output format key/value pairs in use.
See Also:
Serializer.getOutputFormat()

getOutputStream

public java.io.OutputStream getOutputStream()
Description copied from interface: Serializer
Get the output stream where the events will be serialized to.

Specified by:
getOutputStream in interface Serializer
Returns:
reference to the result stream, or null if only a writer was set.
See Also:
Serializer.getOutputStream()

getWriter

public java.io.Writer getWriter()
Description copied from interface: Serializer
Get the character stream where the events will be serialized to.

Specified by:
getWriter in interface Serializer
Returns:
Reference to the result Writer, or null.
See Also:
Serializer.getWriter()

reset

public boolean reset()
Description copied from interface: Serializer
This method resets the serializer. If this method returns true, the serializer may be used for subsequent serialization of new documents. It is possible to change the output format and output stream prior to serializing, or to reuse the existing output format and output stream or writer.

Specified by:
reset in interface Serializer
Returns:
True if serializer has been reset and can be reused
See Also:
Serializer.reset()

serialize

public void serialize(org.w3c.dom.Node node)
               throws java.io.IOException
Description copied from interface: DOMSerializer
Serializes the DOM node. Throws an exception only if an I/O exception occured while serializing. This interface is a public API.

Specified by:
serialize in interface DOMSerializer
Specified by:
serialize in interface SerializationHandler
Parameters:
node - the DOM node to serialize
Throws:
java.io.IOException - if an I/O exception occured while serializing
See Also:
SerializationHandler.serialize(org.w3c.dom.Node)

setCdataSectionElements

public void setCdataSectionElements(java.util.Vector URI_and_localNames)
Description copied from interface: XSLOutputAttributes
Sets the value coming from the xsl:output cdata-section-elements stylesheet property. This sets the elements whose text elements are to be output as CDATA sections.

Specified by:
setCdataSectionElements in interface XSLOutputAttributes
Parameters:
URI_and_localNames - pairs of namespace URI and local names that identify elements whose text elements are to be output as CDATA sections. The namespace of the local element must be the given URI to match. The qName is not given because the prefix does not matter, only the namespace URI to which that prefix would map matters, so the prefix itself is not relevant in specifying which elements have their text to be output as CDATA sections.
See Also:
XSLOutputAttributes.setCdataSectionElements(java.util.Vector)

setEscaping

public boolean setEscaping(boolean escape)
                    throws org.xml.sax.SAXException
Description copied from interface: SerializationHandler
Turns special character escaping on/off. Note that characters will never, even if this option is set to 'true', be escaped within CDATA sections in output XML documents.

Specified by:
setEscaping in interface SerializationHandler
Parameters:
escape - true if escaping is to be set on.
Throws:
org.xml.sax.SAXException
See Also:
SerializationHandler.setEscaping(boolean)

setIndent

public void setIndent(boolean indent)
Description copied from interface: XSLOutputAttributes
Sets the value coming from the xsl:output indent stylesheet attribute.

Specified by:
setIndent in interface XSLOutputAttributes
Parameters:
indent - true if the output document should be indented to visually indicate its structure.
See Also:
XSLOutputAttributes.setIndent(boolean)

setIndentAmount

public void setIndentAmount(int spaces)
Description copied from interface: SerializationHandler
Set the number of spaces to indent for each indentation level.

Specified by:
setIndentAmount in interface SerializationHandler
Parameters:
spaces - the number of spaces to indent for each indentation level.
See Also:
SerializationHandler.setIndentAmount(int)

setOutputFormat

public void setOutputFormat(java.util.Properties format)
Description copied from interface: Serializer
Specifies an output format for this serializer. It the serializer has already been associated with an output format, it will switch to the new format. This method should not be called while the serializer is in the process of serializing a document.

The standard property keys supported are: "method", "version", "encoding", "omit-xml-declaration", "standalone", doctype-public", "doctype-system", "cdata-section-elements", "indent", "media-type". These property keys and their values are described in the XSLT recommendation, see XSLT 1.0 recommendation

The non-standard property keys supported are defined in OutputPropertiesFactory.

This method can be called multiple times before a document is serialized. Each time it is called more, or over-riding property values, can be specified. One property value that can not be changed is that of the "method" property key.

The value of the "cdata-section-elements" property key is a whitespace separated list of elements. If the element is in a namespace then value is passed in this format: {uri}localName

If the "cdata-section-elements" key is specified on multiple calls to this method the set of elements specified in the value is not replaced from one call to the next, but it is cumulative across the calls.

Specified by:
setOutputFormat in interface Serializer
Parameters:
format - The output format to use, as a set of key/value pairs.
See Also:
Serializer.setOutputFormat(java.util.Properties)

setOutputStream

public void setOutputStream(java.io.OutputStream output)
Description copied from interface: Serializer
Specifies an output stream to which the document should be serialized. This method should not be called while the serializer is in the process of serializing a document.

The encoding specified in the output Properties is used, or if no encoding was specified, the default for the selected output method.

Only one of setWriter() or setOutputStream() should be called.

Specified by:
setOutputStream in interface Serializer
Parameters:
output - The output stream
See Also:
Serializer.setOutputStream(java.io.OutputStream)

setVersion

public void setVersion(java.lang.String version)
Description copied from interface: XSLOutputAttributes
Sets the value coming from the xsl:output version attribute.

Specified by:
setVersion in interface XSLOutputAttributes
Parameters:
version - the version of the output format.
See Also:
XSLOutputAttributes.setVersion(java.lang.String)

setWriter

public void setWriter(java.io.Writer writer)
Description copied from interface: Serializer
Specifies a writer to which the document should be serialized. This method should not be called while the serializer is in the process of serializing a document.

The encoding specified for the output Properties must be identical to the output format used with the writer.

Only one of setWriter() or setOutputStream() should be called.

Specified by:
setWriter in interface Serializer
Parameters:
writer - The output writer stream
See Also:
Serializer.setWriter(java.io.Writer)

setTransformer

public void setTransformer(javax.xml.transform.Transformer transformer)
Description copied from interface: SerializationHandler
Set the transformer associated with the serializer.

Specified by:
setTransformer in interface SerializationHandler
Parameters:
transformer - the transformer associated with the serializer.
See Also:
SerializationHandler.setTransformer(javax.xml.transform.Transformer)

getTransformer

public javax.xml.transform.Transformer getTransformer()
Description copied from interface: SerializationHandler
Get the transformer associated with the serializer.

Specified by:
getTransformer in interface SerializationHandler
Returns:
Transformer the transformer associated with the serializer.
See Also:
SerializationHandler.getTransformer()

flushPending

public void flushPending()
                  throws org.xml.sax.SAXException
Description copied from interface: SerializationHandler
A SerializationHandler accepts SAX-like events, so it can accumulate attributes or namespace nodes after a startElement().

If the SerializationHandler has a Writer or OutputStream, a call to this method will flush such accumulated events as a closed start tag for an element.

If the SerializationHandler wraps a ContentHandler, a call to this method will flush such accumulated events as a SAX (not SAX-like) calls to startPrefixMapping() and startElement().

If one calls endDocument() then one need not call this method since a call to endDocument() will do what this method does. However, in some circumstances, such as with document fragments, endDocument() is not called and it may be necessary to call this method to flush any pending events.

For performance reasons this method should not be called very often.

Specified by:
flushPending in interface SerializationHandler
Throws:
org.xml.sax.SAXException
See Also:
SerializationHandler.flushPending()

addAttribute

public void addAttribute(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String rawName,
                         java.lang.String type,
                         java.lang.String value,
                         boolean XSLAttribute)
                  throws org.xml.sax.SAXException
Description copied from interface: ExtendedContentHandler
Add at attribute to the current element

Specified by:
addAttribute in interface ExtendedContentHandler
Parameters:
uri - the namespace URI of the attribute name
localName - the local name of the attribute (without prefix)
rawName - the qualified name of the attribute
type - the attribute type typically character data (CDATA)
value - the value of the attribute
XSLAttribute - true if the added attribute is coming from an xsl:attribute element
Throws:
org.xml.sax.SAXException
See Also:
ExtendedContentHandler.addAttribute(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)

addAttributes

public void addAttributes(org.xml.sax.Attributes atts)
                   throws org.xml.sax.SAXException
Description copied from interface: ExtendedContentHandler
Add attributes to the current element

Specified by:
addAttributes in interface ExtendedContentHandler
Parameters:
atts - the attributes to add.
Throws:
org.xml.sax.SAXException
See Also:
ExtendedContentHandler.addAttributes(org.xml.sax.Attributes)

addAttribute

public void addAttribute(java.lang.String name,
                         java.lang.String value)
Description copied from interface: ExtendedContentHandler
Add an attribute to the current element. The namespace URI of the attribute will be calculated from the prefix of qName. The local name will be derived from qName and the type will be assumed to be "CDATA".

Specified by:
addAttribute in interface ExtendedContentHandler
See Also:
ExtendedContentHandler.addAttribute(java.lang.String, java.lang.String)

characters

public void characters(java.lang.String chars)
                throws org.xml.sax.SAXException
Description copied from interface: ExtendedContentHandler
This method is used to notify of a character event, but passing the data as a character String rather than the standard character array.

Specified by:
characters in interface ExtendedContentHandler
Parameters:
chars - the character data
Throws:
org.xml.sax.SAXException
See Also:
ExtendedContentHandler.characters(java.lang.String)

endElement

public void endElement(java.lang.String elemName)
                throws org.xml.sax.SAXException
Description copied from interface: ExtendedContentHandler
This method is used to notify that an element has ended. Unlike the standard SAX method
 endElement(namespaceURI,localName,qName)
 
only the last parameter is passed. If needed the serializer can derive the localName from the qualified name and derive the namespaceURI from its implementation.

Specified by:
endElement in interface ExtendedContentHandler
Parameters:
elemName - the fully qualified element name.
Throws:
org.xml.sax.SAXException
See Also:
ExtendedContentHandler.endElement(java.lang.String)

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Specified by:
startDocument in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException
See Also:
ContentHandler.startDocument()

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String qName)
                  throws org.xml.sax.SAXException
Description copied from interface: ExtendedContentHandler
This method is used to notify that an element is starting. This method is just like the standard SAX method
 startElement(uri,localName,qname,atts)
 
but without the attributes.

Specified by:
startElement in interface ExtendedContentHandler
Parameters:
uri - the namespace URI of the element
localName - the local name (without prefix) of the element
qName - the qualified name of the element
Throws:
org.xml.sax.SAXException
See Also:
ExtendedContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String)

startElement

public void startElement(java.lang.String qName)
                  throws org.xml.sax.SAXException
Description copied from interface: ExtendedContentHandler
This method is used to notify of the start of an element

Specified by:
startElement in interface ExtendedContentHandler
Parameters:
qName - the fully qualified name of the element
Throws:
org.xml.sax.SAXException
See Also:
ExtendedContentHandler.startElement(java.lang.String)

namespaceAfterStartElement

public void namespaceAfterStartElement(java.lang.String uri,
                                       java.lang.String prefix)
                                throws org.xml.sax.SAXException
Description copied from interface: ExtendedContentHandler
This method is used to notify that a prefix mapping is to start, but after an element is started. The SAX method call
 startPrefixMapping(prefix,uri)
 
is used just before an element starts and applies to the element to come, not to the current element. This method applies to the current element. For example one could make the calls in this order:
 startElement("prfx8:elem9")
 namespaceAfterStartElement("http://namespace8","prfx8")
 

Specified by:
namespaceAfterStartElement in interface ExtendedContentHandler
Parameters:
uri - the namespace URI being declared
prefix - the prefix that maps to the given namespace
Throws:
org.xml.sax.SAXException
See Also:
ExtendedContentHandler.namespaceAfterStartElement(java.lang.String, java.lang.String)

startPrefixMapping

public boolean startPrefixMapping(java.lang.String prefix,
                                  java.lang.String uri,
                                  boolean shouldFlush)
                           throws org.xml.sax.SAXException
Description copied from interface: ExtendedContentHandler
This method is used to notify that a prefix maping is to start, which can be for the current element, or for the one to come.

Specified by:
startPrefixMapping in interface ExtendedContentHandler
Parameters:
prefix - the prefix that maps to the given URI
uri - the namespace URI of the given prefix
shouldFlush - if true this call is like the SAX startPrefixMapping(prefix,uri) call and the mapping applies to the element to come. If false the mapping applies to the current element.
Returns:
boolean false if the prefix mapping was already in effect (in other words we are just re-declaring), true if this is a new, never before seen mapping for the element.
Throws:
org.xml.sax.SAXException
See Also:
ExtendedContentHandler.startPrefixMapping(java.lang.String, java.lang.String, boolean)

entityReference

public void entityReference(java.lang.String entityName)
                     throws org.xml.sax.SAXException
Description copied from interface: ExtendedContentHandler
Notify of an entity reference.

Specified by:
entityReference in interface ExtendedContentHandler
Parameters:
entityName - the name of the entity
Throws:
org.xml.sax.SAXException
See Also:
ExtendedContentHandler.entityReference(java.lang.String)

getNamespaceMappings

public NamespaceMappings getNamespaceMappings()
Description copied from interface: ExtendedContentHandler
This method returns an object that has the current namespace mappings in effect.

Specified by:
getNamespaceMappings in interface ExtendedContentHandler
Returns:
NamespaceMappings an object that has the current namespace mappings in effect.
See Also:
ExtendedContentHandler.getNamespaceMappings()

getPrefix

public java.lang.String getPrefix(java.lang.String uri)
Description copied from interface: ExtendedContentHandler
This method returns the prefix that currently maps to the given namespace URI.

Specified by:
getPrefix in interface ExtendedContentHandler
Parameters:
uri - the namespace URI
Returns:
String the prefix that currently maps to the given URI.
See Also:
ExtendedContentHandler.getPrefix(java.lang.String)

getNamespaceURI

public java.lang.String getNamespaceURI(java.lang.String name,
                                        boolean isElement)
Description copied from interface: ExtendedContentHandler
This method gets the prefix associated with a current element or attribute name.

Specified by:
getNamespaceURI in interface ExtendedContentHandler
Parameters:
name - the qualified name of an element, or attribute
isElement - true if it is an element name, false if it is an atttribute name
Returns:
String the namespace URI associated with the element or attribute.
See Also:
ExtendedContentHandler.getNamespaceURI(java.lang.String, boolean)

getNamespaceURIFromPrefix

public java.lang.String getNamespaceURIFromPrefix(java.lang.String prefix)
Description copied from interface: ExtendedContentHandler
This method returns the namespace URI currently associated with the prefix.

Specified by:
getNamespaceURIFromPrefix in interface ExtendedContentHandler
Parameters:
prefix - a prefix of an element or attribute.
Returns:
String the namespace URI currently associated with the prefix.
See Also:
ExtendedContentHandler.getNamespaceURIFromPrefix(java.lang.String)

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator arg0)
Specified by:
setDocumentLocator in interface org.xml.sax.ContentHandler
See Also:
ContentHandler.setDocumentLocator(org.xml.sax.Locator)

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
Specified by:
endDocument in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException
See Also:
ContentHandler.endDocument()

startPrefixMapping

public void startPrefixMapping(java.lang.String arg0,
                               java.lang.String arg1)
                        throws org.xml.sax.SAXException
Specified by:
startPrefixMapping in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException
See Also:
ContentHandler.startPrefixMapping(java.lang.String, java.lang.String)

endPrefixMapping

public void endPrefixMapping(java.lang.String arg0)
                      throws org.xml.sax.SAXException
Specified by:
endPrefixMapping in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException
See Also:
ContentHandler.endPrefixMapping(java.lang.String)

startElement

public void startElement(java.lang.String arg0,
                         java.lang.String arg1,
                         java.lang.String arg2,
                         org.xml.sax.Attributes arg3)
                  throws org.xml.sax.SAXException
Specified by:
startElement in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException
See Also:
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)

endElement

public void endElement(java.lang.String arg0,
                       java.lang.String arg1,
                       java.lang.String arg2)
                throws org.xml.sax.SAXException
Specified by:
endElement in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException
See Also:
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)

characters

public void characters(char[] arg0,
                       int arg1,
                       int arg2)
                throws org.xml.sax.SAXException
Specified by:
characters in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException
See Also:
ContentHandler.characters(char[], int, int)

ignorableWhitespace

public void ignorableWhitespace(char[] arg0,
                                int arg1,
                                int arg2)
                         throws org.xml.sax.SAXException
Specified by:
ignorableWhitespace in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException
See Also:
ContentHandler.ignorableWhitespace(char[], int, int)

processingInstruction

public void processingInstruction(java.lang.String arg0,
                                  java.lang.String arg1)
                           throws org.xml.sax.SAXException
Specified by:
processingInstruction in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException
See Also:
ContentHandler.processingInstruction(java.lang.String, java.lang.String)

skippedEntity

public void skippedEntity(java.lang.String arg0)
                   throws org.xml.sax.SAXException
Specified by:
skippedEntity in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException
See Also:
ContentHandler.skippedEntity(java.lang.String)

comment

public void comment(java.lang.String comment)
             throws org.xml.sax.SAXException
Description copied from interface: ExtendedLexicalHandler
This method is used to notify of a comment

Specified by:
comment in interface ExtendedLexicalHandler
Parameters:
comment - the comment, but unlike the SAX comment() method this method takes a String rather than a character array.
Throws:
org.xml.sax.SAXException
See Also:
ExtendedLexicalHandler.comment(java.lang.String)

startDTD

public void startDTD(java.lang.String arg0,
                     java.lang.String arg1,
                     java.lang.String arg2)
              throws org.xml.sax.SAXException
Specified by:
startDTD in interface org.xml.sax.ext.LexicalHandler
Throws:
org.xml.sax.SAXException
See Also:
LexicalHandler.startDTD(java.lang.String, java.lang.String, java.lang.String)

endDTD

public void endDTD()
            throws org.xml.sax.SAXException
Specified by:
endDTD in interface org.xml.sax.ext.LexicalHandler
Throws:
org.xml.sax.SAXException
See Also:
LexicalHandler.endDTD()

startEntity

public void startEntity(java.lang.String arg0)
                 throws org.xml.sax.SAXException
Specified by:
startEntity in interface org.xml.sax.ext.LexicalHandler
Throws:
org.xml.sax.SAXException
See Also:
LexicalHandler.startEntity(java.lang.String)

endEntity

public void endEntity(java.lang.String arg0)
               throws org.xml.sax.SAXException
Specified by:
endEntity in interface org.xml.sax.ext.LexicalHandler
Throws:
org.xml.sax.SAXException
See Also:
LexicalHandler.endEntity(java.lang.String)

startCDATA

public void startCDATA()
                throws org.xml.sax.SAXException
Specified by:
startCDATA in interface org.xml.sax.ext.LexicalHandler
Throws:
org.xml.sax.SAXException
See Also:
LexicalHandler.startCDATA()

endCDATA

public void endCDATA()
              throws org.xml.sax.SAXException
Specified by:
endCDATA in interface org.xml.sax.ext.LexicalHandler
Throws:
org.xml.sax.SAXException
See Also:
LexicalHandler.endCDATA()

comment

public void comment(char[] arg0,
                    int arg1,
                    int arg2)
             throws org.xml.sax.SAXException
Specified by:
comment in interface org.xml.sax.ext.LexicalHandler
Throws:
org.xml.sax.SAXException
See Also:
LexicalHandler.comment(char[], int, int)

getDoctypePublic

public java.lang.String getDoctypePublic()
Description copied from interface: XSLOutputAttributes
Returns the previously set value of the value to be used as the public identifier in the document type declaration (DTD).

Specified by:
getDoctypePublic in interface XSLOutputAttributes
Returns:
the public identifier to be used in the DOCTYPE declaration in the output document.
See Also:
XSLOutputAttributes.getDoctypePublic()

getDoctypeSystem

public java.lang.String getDoctypeSystem()
Description copied from interface: XSLOutputAttributes
Returns the previously set value of the value to be used as the system identifier in the document type declaration (DTD).

Specified by:
getDoctypeSystem in interface XSLOutputAttributes
Returns:
the system identifier to be used in the DOCTYPE declaration in the output document.
See Also:
XSLOutputAttributes.getDoctypeSystem()

getEncoding

public java.lang.String getEncoding()
Specified by:
getEncoding in interface XSLOutputAttributes
Returns:
the character encoding to be used in the output document.
See Also:
XSLOutputAttributes.getEncoding()

getIndent

public boolean getIndent()
Specified by:
getIndent in interface XSLOutputAttributes
Returns:
true if the output document should be indented to visually indicate its structure.
See Also:
XSLOutputAttributes.getIndent()

getIndentAmount

public int getIndentAmount()
Specified by:
getIndentAmount in interface XSLOutputAttributes
Returns:
the number of spaces to indent for each indentation level.
See Also:
XSLOutputAttributes.getIndentAmount()

getMediaType

public java.lang.String getMediaType()
Specified by:
getMediaType in interface XSLOutputAttributes
Returns:
the mediatype the media-type or MIME type associated with the output document.
See Also:
XSLOutputAttributes.getMediaType()

getOmitXMLDeclaration

public boolean getOmitXMLDeclaration()
Specified by:
getOmitXMLDeclaration in interface XSLOutputAttributes
Returns:
true if the XML declaration is to be omitted from the output document.
See Also:
XSLOutputAttributes.getOmitXMLDeclaration()

getStandalone

public java.lang.String getStandalone()
Specified by:
getStandalone in interface XSLOutputAttributes
Returns:
a value of "yes" if the standalone delaration is to be included in the output document.
See Also:
XSLOutputAttributes.getStandalone()

getVersion

public java.lang.String getVersion()
Specified by:
getVersion in interface XSLOutputAttributes
Returns:
the version of the output format.
See Also:
XSLOutputAttributes.getVersion()

setCdataSectionElements

public void setCdataSectionElements(java.util.Hashtable h)
                             throws java.lang.Exception
Throws:
java.lang.Exception
See Also:
XSLOutputAttributes.setCdataSectionElements(java.util.Vector)

setDoctype

public void setDoctype(java.lang.String system,
                       java.lang.String pub)
Description copied from interface: XSLOutputAttributes
Set the value coming from the xsl:output doctype-public and doctype-system stylesheet properties

Specified by:
setDoctype in interface XSLOutputAttributes
Parameters:
system - the system identifier to be used in the DOCTYPE declaration in the output document.
pub - the public identifier to be used in the DOCTYPE declaration in the output document.
See Also:
XSLOutputAttributes.setDoctype(java.lang.String, java.lang.String)

setDoctypePublic

public void setDoctypePublic(java.lang.String doctype)
Description copied from interface: XSLOutputAttributes
Set the value coming from the xsl:output doctype-public stylesheet attribute.

Specified by:
setDoctypePublic in interface XSLOutputAttributes
Parameters:
doctype - the public identifier to be used in the DOCTYPE declaration in the output document.
See Also:
XSLOutputAttributes.setDoctypePublic(java.lang.String)

setDoctypeSystem

public void setDoctypeSystem(java.lang.String doctype)
Description copied from interface: XSLOutputAttributes
Set the value coming from the xsl:output doctype-system stylesheet attribute.

Specified by:
setDoctypeSystem in interface XSLOutputAttributes
Parameters:
doctype - the system identifier to be used in the DOCTYPE declaration in the output document.
See Also:
XSLOutputAttributes.setDoctypeSystem(java.lang.String)

setEncoding

public void setEncoding(java.lang.String encoding)
Description copied from interface: XSLOutputAttributes
Sets the character encoding coming from the xsl:output encoding stylesheet attribute.

Specified by:
setEncoding in interface XSLOutputAttributes
Parameters:
encoding - the character encoding
See Also:
XSLOutputAttributes.setEncoding(java.lang.String)

setMediaType

public void setMediaType(java.lang.String mediatype)
Description copied from interface: XSLOutputAttributes
Sets the value coming from the xsl:output media-type stylesheet attribute.

Specified by:
setMediaType in interface XSLOutputAttributes
Parameters:
mediatype - the media-type or MIME type associated with the output document.
See Also:
XSLOutputAttributes.setMediaType(java.lang.String)

setOmitXMLDeclaration

public void setOmitXMLDeclaration(boolean b)
Description copied from interface: XSLOutputAttributes
Sets the value coming from the xsl:output omit-xml-declaration stylesheet attribute

Specified by:
setOmitXMLDeclaration in interface XSLOutputAttributes
Parameters:
b - true if the XML declaration is to be omitted from the output document.
See Also:
XSLOutputAttributes.setOmitXMLDeclaration(boolean)

setStandalone

public void setStandalone(java.lang.String standalone)
Description copied from interface: XSLOutputAttributes
Sets the value coming from the xsl:output standalone stylesheet attribute.

Specified by:
setStandalone in interface XSLOutputAttributes
Parameters:
standalone - a value of "yes" indicates that the standalone delaration is to be included in the output document.
See Also:
XSLOutputAttributes.setStandalone(java.lang.String)

elementDecl

public void elementDecl(java.lang.String arg0,
                        java.lang.String arg1)
                 throws org.xml.sax.SAXException
Specified by:
elementDecl in interface org.xml.sax.ext.DeclHandler
Throws:
org.xml.sax.SAXException
See Also:
DeclHandler.elementDecl(java.lang.String, java.lang.String)

attributeDecl

public void attributeDecl(java.lang.String arg0,
                          java.lang.String arg1,
                          java.lang.String arg2,
                          java.lang.String arg3,
                          java.lang.String arg4)
                   throws org.xml.sax.SAXException
Specified by:
attributeDecl in interface org.xml.sax.ext.DeclHandler
Throws:
org.xml.sax.SAXException
See Also:
DeclHandler.attributeDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)

internalEntityDecl

public void internalEntityDecl(java.lang.String arg0,
                               java.lang.String arg1)
                        throws org.xml.sax.SAXException
Specified by:
internalEntityDecl in interface org.xml.sax.ext.DeclHandler
Throws:
org.xml.sax.SAXException
See Also:
DeclHandler.internalEntityDecl(java.lang.String, java.lang.String)

externalEntityDecl

public void externalEntityDecl(java.lang.String arg0,
                               java.lang.String arg1,
                               java.lang.String arg2)
                        throws org.xml.sax.SAXException
Specified by:
externalEntityDecl in interface org.xml.sax.ext.DeclHandler
Throws:
org.xml.sax.SAXException
See Also:
DeclHandler.externalEntityDecl(java.lang.String, java.lang.String, java.lang.String)

warning

public void warning(org.xml.sax.SAXParseException arg0)
             throws org.xml.sax.SAXException
Specified by:
warning in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException
See Also:
ErrorHandler.warning(org.xml.sax.SAXParseException)

error

public void error(org.xml.sax.SAXParseException arg0)
           throws org.xml.sax.SAXException
Specified by:
error in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException
See Also:
ErrorHandler.error(org.xml.sax.SAXParseException)

fatalError

public void fatalError(org.xml.sax.SAXParseException arg0)
                throws org.xml.sax.SAXException
Specified by:
fatalError in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException
See Also:
ErrorHandler.fatalError(org.xml.sax.SAXParseException)

asDOMSerializer

public DOMSerializer asDOMSerializer()
                              throws java.io.IOException
Description copied from interface: Serializer
Return a DOMSerializer interface into this serializer. Through the returned object the document to be serialized, a DOM, can be provided to the serializer. If the serializer does not support the DOMSerializer interface, it should return null.

In principle only one of asDOMSerializer() or asContentHander() should be called.

Specified by:
asDOMSerializer in interface Serializer
Returns:
A DOMSerializer interface into this serializer, or null if the serializer is not DOM capable
Throws:
java.io.IOException - An I/O exception occured
See Also:
Serializer.asDOMSerializer()

setNamespaceMappings

public void setNamespaceMappings(NamespaceMappings mappings)
Description copied from interface: SerializationHandler
Used only by TransformerSnapshotImpl to restore the serialization to a previous state.

Specified by:
setNamespaceMappings in interface SerializationHandler
Parameters:
mappings - NamespaceMappings
See Also:
SerializationHandler.setNamespaceMappings(NamespaceMappings)

setSourceLocator

public void setSourceLocator(javax.xml.transform.SourceLocator locator)
Description copied from interface: ExtendedContentHandler
This method is used to set the source locator, which might be used to generated an error message.

Specified by:
setSourceLocator in interface ExtendedContentHandler
Parameters:
locator - the source locator
See Also:
ExtendedContentHandler.setSourceLocator(javax.xml.transform.SourceLocator)

addUniqueAttribute

public void addUniqueAttribute(java.lang.String name,
                               java.lang.String value,
                               int flags)
                        throws org.xml.sax.SAXException
Description copied from interface: ExtendedContentHandler
Add a unique attribute to the current element. The attribute is guaranteed to be unique here. The serializer can write it out immediately without saving it in a table first. The integer flag contains information about the attribute, which helps the serializer to decide whether a particular processing is needed.

Specified by:
addUniqueAttribute in interface ExtendedContentHandler
Parameters:
name - the fully qualified attribute name.
value - the attribute value
flags - a bitwise flag
Throws:
org.xml.sax.SAXException
See Also:
ExtendedContentHandler.addUniqueAttribute(java.lang.String, java.lang.String, int)

characters

public void characters(org.w3c.dom.Node node)
                throws org.xml.sax.SAXException
Description copied from interface: ExtendedContentHandler
This method is used to notify of a character event, but passing the data as a DOM Node rather than the standard character array.

Specified by:
characters in interface ExtendedContentHandler
Parameters:
node - a DOM Node containing text.
Throws:
org.xml.sax.SAXException
See Also:
ExtendedContentHandler.characters(org.w3c.dom.Node)

addXSLAttribute

public void addXSLAttribute(java.lang.String qName,
                            java.lang.String value,
                            java.lang.String uri)
Description copied from interface: ExtendedContentHandler
Add an attribute from an xsl:attribute element.

Specified by:
addXSLAttribute in interface ExtendedContentHandler
Parameters:
qName - the qualified attribute name (prefix:localName)
value - the attributes value
uri - the uri that the prefix of the qName is mapped to.
See Also:
ExtendedContentHandler.addXSLAttribute(java.lang.String, java.lang.String, java.lang.String)

addAttribute

public void addAttribute(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String rawName,
                         java.lang.String type,
                         java.lang.String value)
                  throws org.xml.sax.SAXException
Description copied from interface: ExtendedContentHandler
Add at attribute to the current element, not from an xsl:attribute element.

Specified by:
addAttribute in interface ExtendedContentHandler
Parameters:
uri - the namespace URI of the attribute name
localName - the local name of the attribute (without prefix)
rawName - the qualified name of the attribute
type - the attribute type typically character data (CDATA)
value - the value of the attribute
Throws:
org.xml.sax.SAXException
See Also:
ExtendedContentHandler.addAttribute(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)

notationDecl

public void notationDecl(java.lang.String arg0,
                         java.lang.String arg1,
                         java.lang.String arg2)
                  throws org.xml.sax.SAXException
Specified by:
notationDecl in interface org.xml.sax.DTDHandler
Throws:
org.xml.sax.SAXException
See Also:
DTDHandler.notationDecl(java.lang.String, java.lang.String, java.lang.String)

unparsedEntityDecl

public void unparsedEntityDecl(java.lang.String arg0,
                               java.lang.String arg1,
                               java.lang.String arg2,
                               java.lang.String arg3)
                        throws org.xml.sax.SAXException
Specified by:
unparsedEntityDecl in interface org.xml.sax.DTDHandler
Throws:
org.xml.sax.SAXException
See Also:
DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)

setDTDEntityExpansion

public void setDTDEntityExpansion(boolean expand)
Description copied from interface: SerializationHandler
Default behavior is to expand DTD entities, that is the initall default value is true.

Specified by:
setDTDEntityExpansion in interface SerializationHandler
Parameters:
expand - true if DTD entities are to be expanded, false if they are to be left as DTD entity references.
See Also:
SerializationHandler.setDTDEntityExpansion(boolean)

getOutputProperty

public java.lang.String getOutputProperty(java.lang.String name)
Description copied from interface: XSLOutputAttributes
Get the value for a property that affects seraialization, if a property was set return that value, otherwise return the default value, otherwise return null.

Specified by:
getOutputProperty in interface XSLOutputAttributes
Parameters:
name - The name of the property, which is just the local name if it is in no namespace, but is the URI in curly braces followed by the local name if it is in a namespace, for example:
  • "encoding"
  • "method"
  • "{http://xml.apache.org/xalan}indent-amount"
  • "{http://xml.apache.org/xalan}line-separator"
Returns:
The value of the parameter

getOutputPropertyDefault

public java.lang.String getOutputPropertyDefault(java.lang.String name)
Description copied from interface: XSLOutputAttributes
Get the default value for a property that affects seraialization, or null if there is none. It is possible that a non-default value was set for the property, however the value returned by this method is unaffected by any non-default settings.

Specified by:
getOutputPropertyDefault in interface XSLOutputAttributes
Parameters:
name - The name of the property.
Returns:
The default value of the parameter, or null if there is no default value.

setOutputProperty

public void setOutputProperty(java.lang.String name,
                              java.lang.String val)
Description copied from interface: XSLOutputAttributes
Set the non-default value for a property that affects seraialization.

Specified by:
setOutputProperty in interface XSLOutputAttributes
Parameters:
name - The name of the property, which is just the local name if it is in no namespace, but is the URI in curly braces followed by the local name if it is in a namespace, for example:
  • "encoding"
  • "method"
  • "{http://xml.apache.org/xalan}indent-amount"
  • "{http://xml.apache.org/xalan}line-separator"

setOutputPropertyDefault

public void setOutputPropertyDefault(java.lang.String name,
                                     java.lang.String val)
Description copied from interface: XSLOutputAttributes
Set the default value for a property that affects seraialization.

Specified by:
setOutputPropertyDefault in interface XSLOutputAttributes
Parameters:
name - The name of the property, which is just the local name if it is in no namespace, but is the URI in curly braces followed by the local name if it is in a namespace, for example:
  • "encoding"
  • "method"
  • "{http://xml.apache.org/xalan}indent-amount"
  • "{http://xml.apache.org/xalan}line-separator"

asDOM3Serializer

public java.lang.Object asDOM3Serializer()
                                  throws java.io.IOException
Description copied from interface: Serializer
Return an Object into this serializer to be cast to a DOM3Serializer. Through the returned object the document to be serialized, a DOM (Level 3), can be provided to the serializer. If the serializer does not support casting to a DOM3Serializer interface, it should return null.

In principle only one of asDOM3Serializer() or asContentHander() should be called.

Specified by:
asDOM3Serializer in interface Serializer
Returns:
An Object to be cast to a DOM3Serializer interface into this serializer, or null if the serializer is not DOM capable
Throws:
java.io.IOException - An I/O exception occured
See Also:
Serializer.asDOM3Serializer()