org.apache.xml.serializer

Class ToUnknownStream

Implemented Interfaces:
ContentHandler, DeclHandler, DOM2DTM.CharacterNodeHandler, DOMSerializer, ErrorHandler, ExtendedContentHandler, ExtendedLexicalHandler, LexicalHandler, SerializationHandler, Serializer, SerializerConstants, XSLOutputAttributes

public class ToUnknownStream
extends SerializerBase

This class wraps another SerializationHandler. The wrapped object will either handler XML or HTML, which is not known until a little later when the first XML tag is seen. If the first tag is then the wrapped object is an HTML handler, otherwise it is an XML handler. This class effectively caches the first few calls to it then passes them on to the wrapped handler (once it exists). After that subsequent calls a simply passed directly to the wrapped handler. The user of this class doesn't know if the output is ultimatley XML or HTML.

Fields inherited from interface org.apache.xml.serializer.ExtendedContentHandler

HTML_ATTREMPTY, HTML_ATTRURL, NO_BAD_CHARS

Fields inherited from interface org.apache.xml.serializer.SerializerConstants

BEGCDATA, CDATA_CONTINUE, CDATA_DELIMITER_CLOSE, CDATA_DELIMITER_OPEN, CNTCDATA, DEFAULT_SAX_SERIALIZER, EMPTYSTRING, ENDCDATA, ENTITY_AMP, ENTITY_CRLF, ENTITY_GT, ENTITY_LT, ENTITY_QUOT, XMLNS_PREFIX, XMLNS_URI, XML_PREFIX

Constructor Summary

ToUnknownStream()
Default constructor.

Method Summary

void
addAttribute(String rawName, String value)
Adds an attribute to the currenly open tag
void
addAttribute(String uri, String localName, String rawName, String type, String value)
Adds an attribute to the currenly open tag
void
addAttributes(Attributes atts)
void
addUniqueAttribute(String rawName, String value, int flags)
Adds a unique attribute to the currenly open tag
ContentHandler
asContentHandler()
DOMSerializer
asDOMSerializer()
void
attributeDecl(String arg0, String arg1, String arg2, String arg3, String arg4)
Pass the call on to the underlying handler
void
characters(String chars)
Converts the String to a character array and calls the SAX method characters(char[],int,int);
void
characters(char[] characters, int offset, int length)
Pass the call on to the underlying handler
void
close()
void
comment(String comment)
Pass the call on to the underlying handler
void
comment(char[] ch, int start, int length)
Pass the call on to the underlying handler
void
elementDecl(String arg0, String arg1)
Pass the call on to the underlying handler
void
endCDATA()
Pass the call on to the underlying handler
void
endDTD()
Pass the call on to the underlying handler
void
endDocument()
Pass the call on to the underlying handler
void
endElement(String elementName)
Pass the call on to the underlying handler
void
endElement(String namespaceURI, String localName, String qName)
Pass the call on to the underlying handler
void
endEntity(String name)
Pass the call on to the underlying handler
void
endPrefixMapping(String prefix)
Pass the call on to the underlying handler
void
entityReference(String entityName)
void
externalEntityDecl(String name, String publicId, String systemId)
Pass the call on to the underlying handler
void
flushPending()
String
getDoctypePublic()
Pass the call on to the underlying handler
String
getDoctypeSystem()
Pass the call on to the underlying handler
String
getEncoding()
Pass the call on to the underlying handler
boolean
getIndent()
Pass the call on to the underlying handler
int
getIndentAmount()
Pass the call on to the underlying handler
String
getMediaType()
Pass the call on to the underlying handler
NamespaceMappings
getNamespaceMappings()
Get the current namespace mappings.
String
getNamespaceURI(String qname, boolean isElement)
String
getNamespaceURIFromPrefix(String prefix)
Returns the URI of prefix (if any)
boolean
getOmitXMLDeclaration()
Pass the call on to the underlying handler
Properties
getOutputFormat()
OutputStream
getOutputStream()
String
getPrefix(String namespaceURI)
String
getStandalone()
Pass the call on to the underlying handler
Transformer
getTransformer()
Gets the transformer associated with this serializer
String
getVersion()
Pass the call on to the underlying handler
Writer
getWriter()
void
ignorableWhitespace(char[] ch, int start, int length)
Pass the call on to the underlying handler
void
internalEntityDecl(String arg0, String arg1)
Pass the call on to the underlying handler
void
namespaceAfterStartElement(String prefix, String uri)
This method is used when a prefix/uri namespace mapping is indicated after the element was started with a startElement() and before and endElement().
void
processingInstruction(String target, String data)
Pass the call on to the underlying handler
boolean
reset()
passes the call on to the underlying HTML or XML handler
void
serialize(Node node)
Converts the DOM node to output
void
setCdataSectionElements(Vector URI_and_localNames)
void
setContentHandler(ContentHandler ch)
void
setDoctype(String system, String pub)
void
setDoctypePublic(String doctype)
Set the doctype in the underlying XML handler.
void
setDoctypeSystem(String doctype)
Set the doctype in the underlying XML handler.
void
setDocumentLocator(Locator locator)
Pass the call on to the underlying handler
void
setEncoding(String encoding)
Pass the call on to the underlying handler
boolean
setEscaping(boolean escape)
void
setIndent(boolean indent)
Pass the call on to the underlying handler
void
setIndentAmount(int value)
Pass the call on to the underlying handler
void
setMediaType(String mediaType)
void
setOmitXMLDeclaration(boolean b)
Pass the call on to the underlying handler
void
setOutputFormat(Properties format)
Set the properties of the handler
void
setOutputStream(OutputStream output)
Sets the output stream to write to
void
setSourceLocator(SourceLocator locator)
This method is used to set the source locator, which might be used to generated an error message.
void
setStandalone(String standalone)
Pass the call on to the underlying handler
void
setTransformer(Transformer t)
Sets the transformer associated with this serializer
void
setVersion(String version)
This method cannot be cached because default is different in HTML and XML (we need more than a boolean).
void
setWriter(Writer writer)
Sets the writer to write to
void
skippedEntity(String name)
Pass the call on to the underlying handler
void
startCDATA()
Pass the call on to the underlying handler
void
startDTD(String name, String publicId, String systemId)
Pass the call on to the underlying handler
void
startDocument()
void
startElement(String qName)
This method is used to notify of the start of an element
void
startElement(String namespaceURI, String localName, String qName)
This method is used to notify that an element is starting.
void
startElement(String namespaceURI, String localName, String elementName, Attributes atts)
Receive notification of the beginning of an element.
void
startEntity(String name)
Pass the call on to the underlying handler
void
startPrefixMapping(String prefix, String uri)
boolean
startPrefixMapping(String prefix, 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.

Methods inherited from class org.apache.xml.serializer.SerializerBase

addAttribute, addAttribute, addAttributeAlways, addAttributes, 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, reset, setDoctype, setDoctypePublic, setDoctypeSystem, setDocumentLocator, setEncoding, setIndent, setIndentAmount, setMediaType, setNamespaceMappings, setOmitXMLDeclaration, setSourceLocator, setStandalone, setTransformer, setVersion, startDocument, warning

Constructor Details

ToUnknownStream

public ToUnknownStream()
Default constructor. Initially this object wraps an XML Stream object, so _handler is never null. That may change later to an HTML Stream object.

Method Details

addAttribute

public void addAttribute(String rawName,
                         String value)
Adds an attribute to the currenly open tag
Specified by:
addAttribute in interface ExtendedContentHandler
Overrides:
addAttribute in interface SerializerBase

Parameters:
value - the value of the parameter

See Also:
ExtendedContentHandler.addAttribute(String,String)


addAttribute

public void addAttribute(String uri,
                         String localName,
                         String rawName,
                         String type,
                         String value)
            throws SAXException
Adds an attribute to the currenly open tag
Specified by:
addAttribute in interface ExtendedContentHandler
Overrides:
addAttribute in interface SerializerBase

Parameters:
uri - the URI of a namespace
localName - the attribute name, without prefix
rawName - the attribute name, with prefix (if any)
type - the type of the attribute, typically "CDATA"
value - the value of the parameter

See Also:
ExtendedContentHandler.addAttribute(String,String,String,String,String)


addAttributes

public void addAttributes(Attributes atts)
            throws SAXException
Specified by:
addAttributes in interface ExtendedContentHandler
Overrides:
addAttributes in interface SerializerBase

See Also:
ExtendedContentHandler.addAttributes(Attributes)


addUniqueAttribute

public void addUniqueAttribute(String rawName,
                               String value,
                               int flags)
            throws SAXException
Adds a unique attribute to the currenly open tag
Specified by:
addUniqueAttribute in interface ExtendedContentHandler


asContentHandler

public ContentHandler asContentHandler()
            throws IOException
Specified by:
asContentHandler in interface Serializer
Overrides:
asContentHandler in interface SerializerBase

Returns:
the wrapped XML or HTML handler

See Also:
Serializer.asContentHandler()


asDOMSerializer

public DOMSerializer asDOMSerializer()
            throws IOException
Specified by:
asDOMSerializer in interface Serializer
Overrides:
asDOMSerializer in interface SerializerBase

See Also:
Serializer.asDOMSerializer()


attributeDecl

public void attributeDecl(String arg0,
                          String arg1,
                          String arg2,
                          String arg3,
                          String arg4)
            throws SAXException
Pass the call on to the underlying handler
Specified by:
attributeDecl in interface DeclHandler

See Also:
DeclHandler.attributeDecl(String,String,String,String,String)


characters

public void characters(String chars)
            throws SAXException
Converts the String to a character array and calls the SAX method characters(char[],int,int);
Specified by:
characters in interface ExtendedContentHandler

See Also:
ExtendedContentHandler.characters(String)


characters

public void characters(char[] characters,
                       int offset,
                       int length)
            throws SAXException
Pass the call on to the underlying handler

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


close

public void close()
Specified by:
close in interface SerializationHandler
Overrides:
close in interface SerializerBase

See Also:
SerializationHandler.close()


comment

public void comment(String comment)
            throws SAXException
Pass the call on to the underlying handler
Specified by:
comment in interface ExtendedLexicalHandler
Overrides:
comment in interface SerializerBase

See Also:
ExtendedLexicalHandler.comment(String)


comment

public void comment(char[] ch,
                    int start,
                    int length)
            throws SAXException
Pass the call on to the underlying handler

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


elementDecl

public void elementDecl(String arg0,
                        String arg1)
            throws SAXException
Pass the call on to the underlying handler
Specified by:
elementDecl in interface DeclHandler

See Also:
DeclHandler.elementDecl(String,String)


endCDATA

public void endCDATA()
            throws SAXException
Pass the call on to the underlying handler
Specified by:
endCDATA in interface LexicalHandler

See Also:
LexicalHandler.endCDATA()


endDTD

public void endDTD()
            throws SAXException
Pass the call on to the underlying handler
Specified by:
endDTD in interface LexicalHandler

See Also:
LexicalHandler.endDTD()


endDocument

public void endDocument()
            throws SAXException
Pass the call on to the underlying handler
Specified by:
endDocument in interface ContentHandler

See Also:
ContentHandler.endDocument()


endElement

public void endElement(String elementName)
            throws SAXException
Pass the call on to the underlying handler
Specified by:
endElement in interface ExtendedContentHandler

See Also:
ExtendedContentHandler.endElement(String)


endElement

public void endElement(String namespaceURI,
                       String localName,
                       String qName)
            throws SAXException
Pass the call on to the underlying handler
Specified by:
endElement in interface ContentHandler

See Also:
ContentHandler.endElement(String,String,String)


endEntity

public void endEntity(String name)
            throws SAXException
Pass the call on to the underlying handler
Specified by:
endEntity in interface LexicalHandler
Overrides:
endEntity in interface SerializerBase

See Also:
LexicalHandler.endEntity(String)


endPrefixMapping

public void endPrefixMapping(String prefix)
            throws SAXException
Pass the call on to the underlying handler
Specified by:
endPrefixMapping in interface ContentHandler

See Also:
ContentHandler.endPrefixMapping(String)


entityReference

public void entityReference(String entityName)
            throws SAXException
Specified by:
entityReference in interface ExtendedContentHandler
Overrides:
entityReference in interface SerializerBase

See Also:
org.apache.xml.serializer.ExtendedContentHandler.entityReference(java.lang.String)


externalEntityDecl

public void externalEntityDecl(String name,
                               String publicId,
                               String systemId)
            throws SAXException
Pass the call on to the underlying handler
Specified by:
externalEntityDecl in interface DeclHandler

See Also:
DeclHandler.externalEntityDecl(String,String,String)


flushPending

public void flushPending()
            throws SAXException
Specified by:
flushPending in interface SerializationHandler

See Also:
SerializationHandler.flushPending()


getDoctypePublic

public String getDoctypePublic()
Pass the call on to the underlying handler
Specified by:
getDoctypePublic in interface XSLOutputAttributes
Overrides:
getDoctypePublic in interface SerializerBase

See Also:
XSLOutputAttributes.getDoctypePublic()


getDoctypeSystem

public String getDoctypeSystem()
Pass the call on to the underlying handler
Specified by:
getDoctypeSystem in interface XSLOutputAttributes
Overrides:
getDoctypeSystem in interface SerializerBase

See Also:
XSLOutputAttributes.getDoctypeSystem()


getEncoding

public String getEncoding()
Pass the call on to the underlying handler
Specified by:
getEncoding in interface XSLOutputAttributes
Overrides:
getEncoding in interface SerializerBase

See Also:
XSLOutputAttributes.getEncoding()


getIndent

public boolean getIndent()
Pass the call on to the underlying handler
Specified by:
getIndent in interface XSLOutputAttributes
Overrides:
getIndent in interface SerializerBase

See Also:
XSLOutputAttributes.getIndent()


getIndentAmount

public int getIndentAmount()
Pass the call on to the underlying handler
Specified by:
getIndentAmount in interface XSLOutputAttributes
Overrides:
getIndentAmount in interface SerializerBase

See Also:
XSLOutputAttributes.getIndentAmount()


getMediaType

public String getMediaType()
Pass the call on to the underlying handler
Specified by:
getMediaType in interface XSLOutputAttributes
Overrides:
getMediaType in interface SerializerBase

See Also:
XSLOutputAttributes.getMediaType()


getNamespaceMappings

public NamespaceMappings getNamespaceMappings()
Get the current namespace mappings. Simply returns the mappings of the wrapped handler.
Specified by:
getNamespaceMappings in interface ExtendedContentHandler
Overrides:
getNamespaceMappings in interface SerializerBase

See Also:
ExtendedContentHandler.getNamespaceMappings()


getNamespaceURI

public String getNamespaceURI(String qname,
                              boolean isElement)
Specified by:
getNamespaceURI in interface ExtendedContentHandler
Overrides:
getNamespaceURI in interface SerializerBase

See Also:
org.apache.xml.serializer.ExtendedContentHandler.getNamespaceURI(java.lang.String, boolean)


getNamespaceURIFromPrefix

public String getNamespaceURIFromPrefix(String prefix)
Returns the URI of prefix (if any)
Specified by:
getNamespaceURIFromPrefix in interface ExtendedContentHandler
Overrides:
getNamespaceURIFromPrefix in interface SerializerBase

Parameters:
prefix - the prefix whose URI is searched for

Returns:
the namespace URI currently associated with the prefix, null if the prefix is undefined.


getOmitXMLDeclaration

public boolean getOmitXMLDeclaration()
Pass the call on to the underlying handler
Specified by:
getOmitXMLDeclaration in interface XSLOutputAttributes
Overrides:
getOmitXMLDeclaration in interface SerializerBase

See Also:
XSLOutputAttributes.getOmitXMLDeclaration()


getOutputFormat

public Properties getOutputFormat()
Specified by:
getOutputFormat in interface Serializer

Returns:
the properties of the underlying handler

See Also:
Serializer.getOutputFormat()


getOutputStream

public OutputStream getOutputStream()
Specified by:
getOutputStream in interface Serializer

Returns:
the OutputStream of the underlying XML or HTML handler

See Also:
Serializer.getOutputStream()


getPrefix

public String getPrefix(String namespaceURI)
Specified by:
getPrefix in interface ExtendedContentHandler
Overrides:
getPrefix in interface SerializerBase

See Also:
ExtendedContentHandler.getPrefix(String)


getStandalone

public String getStandalone()
Pass the call on to the underlying handler
Specified by:
getStandalone in interface XSLOutputAttributes
Overrides:
getStandalone in interface SerializerBase

See Also:
XSLOutputAttributes.getStandalone()


getTransformer

public Transformer getTransformer()
Gets the transformer associated with this serializer
Specified by:
getTransformer in interface SerializationHandler
Overrides:
getTransformer in interface SerializerBase

Returns:
returns the transformer associated with this serializer.

See Also:
SerializationHandler.getTransformer()


getVersion

public String getVersion()
Pass the call on to the underlying handler
Specified by:
getVersion in interface XSLOutputAttributes
Overrides:
getVersion in interface SerializerBase

See Also:
XSLOutputAttributes.getVersion()


getWriter

public Writer getWriter()
Specified by:
getWriter in interface Serializer

Returns:
the Writer of the underlying XML or HTML handler

See Also:
Serializer.getWriter()


ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
            throws SAXException
Pass the call on to the underlying handler

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


internalEntityDecl

public void internalEntityDecl(String arg0,
                               String arg1)
            throws SAXException
Pass the call on to the underlying handler
Specified by:
internalEntityDecl in interface DeclHandler

See Also:
DeclHandler.internalEntityDecl(String,String)


namespaceAfterStartElement

public void namespaceAfterStartElement(String prefix,
                                       String uri)
            throws SAXException
This method is used when a prefix/uri namespace mapping is indicated after the element was started with a startElement() and before and endElement(). startPrefixMapping(prefix,uri) would be used before the startElement() call.
Specified by:
namespaceAfterStartElement in interface ExtendedContentHandler
Overrides:
namespaceAfterStartElement in interface SerializerBase

Parameters:
prefix - the prefix associated with the given URI.
uri - the URI of the namespace

See Also:
ExtendedContentHandler.namespaceAfterStartElement(String,String)


processingInstruction

public void processingInstruction(String target,
                                  String data)
            throws SAXException
Pass the call on to the underlying handler
Specified by:
processingInstruction in interface ContentHandler

See Also:
ContentHandler.processingInstruction(String,String)


reset

public boolean reset()
passes the call on to the underlying HTML or XML handler
Specified by:
reset in interface Serializer
Overrides:
reset in interface SerializerBase

Returns:
???

See Also:
Serializer.reset()


serialize

public void serialize(Node node)
            throws IOException
Converts the DOM node to output
Specified by:
serialize in interface SerializationHandler
serialize in interface DOMSerializer

Parameters:
node - the DOM node to transform to output

See Also:
DOMSerializer.serialize(Node)


setCdataSectionElements

public void setCdataSectionElements(Vector URI_and_localNames)
Specified by:
setCdataSectionElements in interface XSLOutputAttributes

Parameters:
URI_and_localNames - Vector a list of pairs of URI/localName specified in the cdata-section-elements attribute

See Also:
org.apache.xml.serializer.SerializationHandler.setCdataSectionElements(java.util.Vector)


setContentHandler

public void setContentHandler(ContentHandler ch)
Specified by:
setContentHandler in interface SerializationHandler

See Also:
SerializationHandler.setContentHandler(ContentHandler)


setDoctype

public void setDoctype(String system,
                       String pub)
Specified by:
setDoctype in interface XSLOutputAttributes
Overrides:
setDoctype in interface SerializerBase

See Also:
XSLOutputAttributes.setDoctype(String,String)


setDoctypePublic

public void setDoctypePublic(String doctype)
Set the doctype in the underlying XML handler. Remember that this method was called, just in case we need to transfer this doctype to an HTML handler
Specified by:
setDoctypePublic in interface XSLOutputAttributes
Overrides:
setDoctypePublic in interface SerializerBase

Parameters:
doctype - the public doctype to set

See Also:
XSLOutputAttributes.setDoctypePublic(String)


setDoctypeSystem

public void setDoctypeSystem(String doctype)
Set the doctype in the underlying XML handler. Remember that this method was called, just in case we need to transfer this doctype to an HTML handler
Specified by:
setDoctypeSystem in interface XSLOutputAttributes
Overrides:
setDoctypeSystem in interface SerializerBase

Parameters:
doctype - the system doctype to set

See Also:
XSLOutputAttributes.setDoctypeSystem(String)


setDocumentLocator

public void setDocumentLocator(Locator locator)
Pass the call on to the underlying handler
Specified by:
setDocumentLocator in interface ContentHandler
Overrides:
setDocumentLocator in interface SerializerBase

See Also:
ContentHandler.setDocumentLocator(Locator)


setEncoding

public void setEncoding(String encoding)
Pass the call on to the underlying handler
Specified by:
setEncoding in interface XSLOutputAttributes
Overrides:
setEncoding in interface SerializerBase

See Also:
XSLOutputAttributes.setEncoding(String)


setEscaping

public boolean setEscaping(boolean escape)
            throws SAXException
Specified by:
setEscaping in interface SerializationHandler

See Also:
SerializationHandler.setEscaping(boolean)


setIndent

public void setIndent(boolean indent)
Pass the call on to the underlying handler
Specified by:
setIndent in interface XSLOutputAttributes
Overrides:
setIndent in interface SerializerBase

See Also:
XSLOutputAttributes.setIndent(boolean)


setIndentAmount

public void setIndentAmount(int value)
Pass the call on to the underlying handler
Specified by:
setIndentAmount in interface SerializationHandler
Overrides:
setIndentAmount in interface SerializerBase


setMediaType

public void setMediaType(String mediaType)
Specified by:
setMediaType in interface XSLOutputAttributes
Overrides:
setMediaType in interface SerializerBase

See Also:
XSLOutputAttributes.setMediaType(String)


setOmitXMLDeclaration

public void setOmitXMLDeclaration(boolean b)
Pass the call on to the underlying handler
Specified by:
setOmitXMLDeclaration in interface XSLOutputAttributes
Overrides:
setOmitXMLDeclaration in interface SerializerBase

See Also:
XSLOutputAttributes.setOmitXMLDeclaration(boolean)


setOutputFormat

public void setOutputFormat(Properties format)
Set the properties of the handler
Specified by:
setOutputFormat in interface Serializer

Parameters:
format - the output properties to set

See Also:
Serializer.setOutputFormat(Properties)


setOutputStream

public void setOutputStream(OutputStream output)
Sets the output stream to write to
Specified by:
setOutputStream in interface Serializer

Parameters:
output - the OutputStream to write to

See Also:
Serializer.setOutputStream(OutputStream)


setSourceLocator

public void setSourceLocator(SourceLocator locator)
This method is used to set the source locator, which might be used to generated an error message.
Specified by:
setSourceLocator in interface ExtendedContentHandler
Overrides:
setSourceLocator in interface SerializerBase

Parameters:
locator - the source locator

See Also:
ExtendedContentHandler.setSourceLocator(SourceLocator)


setStandalone

public void setStandalone(String standalone)
Pass the call on to the underlying handler
Specified by:
setStandalone in interface XSLOutputAttributes
Overrides:
setStandalone in interface SerializerBase

See Also:
XSLOutputAttributes.setStandalone(String)


setTransformer

public void setTransformer(Transformer t)
Sets the transformer associated with this serializer
Specified by:
setTransformer in interface SerializationHandler
Overrides:
setTransformer in interface SerializerBase

Parameters:
t - the transformer associated with this serializer.

See Also:
SerializationHandler.setTransformer(Transformer)


setVersion

public void setVersion(String version)
This method cannot be cached because default is different in HTML and XML (we need more than a boolean).
Specified by:
setVersion in interface XSLOutputAttributes
Overrides:
setVersion in interface SerializerBase


setWriter

public void setWriter(Writer writer)
Sets the writer to write to
Specified by:
setWriter in interface Serializer

Parameters:
writer - the writer to write to

See Also:
Serializer.setWriter(Writer)


skippedEntity

public void skippedEntity(String name)
            throws SAXException
Pass the call on to the underlying handler
Specified by:
skippedEntity in interface ContentHandler

See Also:
ContentHandler.skippedEntity(String)


startCDATA

public void startCDATA()
            throws SAXException
Pass the call on to the underlying handler
Specified by:
startCDATA in interface LexicalHandler

See Also:
LexicalHandler.startCDATA()


startDTD

public void startDTD(String name,
                     String publicId,
                     String systemId)
            throws SAXException
Pass the call on to the underlying handler
Specified by:
startDTD in interface LexicalHandler

See Also:
LexicalHandler.startDTD(String,String,String)


startDocument

public void startDocument()
            throws SAXException
Specified by:
startDocument in interface ContentHandler
Overrides:
startDocument in interface SerializerBase

See Also:
ContentHandler.startDocument()


startElement

public void startElement(String qName)
            throws SAXException
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:
SAXException -


startElement

public void startElement(String namespaceURI,
                         String localName,
                         String qName)
            throws SAXException
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:
localName - the local name (without prefix) of the element
qName - the qualified name of the element

Throws:
SAXException -


startElement

public void startElement(String namespaceURI,
                         String localName,
                         String elementName,
                         Attributes atts)
            throws SAXException
Receive notification of the beginning of an element.

The Parser will invoke this method at the beginning of every element in the XML document; there will be a corresponding endElement event for every startElement event (even when the element is empty). All of the element's content will be reported, in order, before the corresponding endElement event.

This event allows up to three name components for each element:

  1. the Namespace URI;
  2. the local name; and
  3. the qualified (prefixed) name.

Any or all of these may be provided, depending on the values of the http://xml.org/sax/features/namespaces and the http://xml.org/sax/features/namespace-prefixes properties:

  • the Namespace URI and local name are required when the namespaces property is true (the default), and are optional when the namespaces property is false (if one is specified, both must be);
  • the qualified name is required when the namespace-prefixes property is true, and is optional when the namespace-prefixes property is false (the default).

Note that the attribute list provided will contain only attributes with explicit values (specified or defaulted): #IMPLIED attributes will be omitted. The attribute list will contain attributes used for Namespace declarations (xmlns* attributes) only if the http://xml.org/sax/features/namespace-prefixes property is true (it is false by default, and support for a true value is optional).

Like characters(), attribute values may have characters that need more than one char value.

Specified by:
startElement in interface ContentHandler

Parameters:
localName - The local name (without prefix), or the empty string if Namespace processing is not being performed.
atts - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.

Throws:
SAXException - Any SAX exception, possibly wrapping another exception.

See Also:
ContentHandler.endElement(String,String,String), Attributes


startEntity

public void startEntity(String name)
            throws SAXException
Pass the call on to the underlying handler
Specified by:
startEntity in interface LexicalHandler

See Also:
LexicalHandler.startEntity(String)


startPrefixMapping

public void startPrefixMapping(String prefix,
                               String uri)
            throws SAXException
Specified by:
startPrefixMapping in interface ContentHandler

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

See Also:
ContentHandler.startPrefixMapping(String,String)


startPrefixMapping

public boolean startPrefixMapping(String prefix,
                                  String uri,
                                  boolean shouldFlush)
            throws SAXException
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:
SAXException -


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