APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.xml.internal.serializer

public final Class ToTextSAXHandler

extends ToSAXHandler
Class Inheritance
Imports
java.io.IOException, .OutputStream, .Writer, java.util.Properties, org.w3c.dom.Node, org.xml.sax.Attributes, .ContentHandler, .Locator, .SAXException, org.xml.sax.ext.LexicalHandler

This class converts SAX-like event to SAX events for xsl:output method "text". This class is only to be used internally. This class is not a public API.

Field Summary

Inherited from com.sun.org.apache.xml.internal.serializer.ToSAXHandler:
m_lexHandlerm_saxHandlerm_state

Constructor Summary

AccessConstructor and Description
public
public
ToTextSAXHandler(ContentHandler handler, String encoding)

From XSLTC

Method Summary

Modifier and TypeMethod and Description
public void
addAttribute(String uri, String localName, String rawName, String type, String value, boolean XSLAttribute)

Overrides com.sun.org.apache.xml.internal.serializer.SerializerBase.addAttribute.

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.addAttribute.

Adds the given attribute to the set of collected attributes , but only if there is a currently open element.

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

Implements org.xml.sax.ext.DeclHandler.attributeDecl.

Report an attribute type declaration.

public void
public void
characters(char[] characters, int offset, int length)

Implements org.xml.sax.ContentHandler.characters.

Receive notification of character data.

public void
comment(char[] ch, int start, int length)

Implements org.xml.sax.ext.LexicalHandler.comment.

Report an XML comment anywhere in the document.

public void
public void
elementDecl(String arg0, String arg1)

Implements org.xml.sax.ext.DeclHandler.elementDecl.

Report an element type declaration.

public void
endCDATA()

Implements org.xml.sax.ext.LexicalHandler.endCDATA.

Report the end of a CDATA section.

public void
public void
endDTD()

Implements org.xml.sax.ext.LexicalHandler.endDTD.

Report the end of DTD declarations.

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

Implements org.xml.sax.ContentHandler.endElement.

Receive notification of the end of an element.

public void
endPrefixMapping(String arg0)

Implements org.xml.sax.ContentHandler.endPrefixMapping.

End the scope of a prefix-URI mapping.

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

Implements org.xml.sax.ext.DeclHandler.externalEntityDecl.

Report a parsed external entity declaration.

public Properties
getOutputFormat()

Implements com.sun.org.apache.xml.internal.serializer.Serializer.getOutputFormat.

Returns the output format properties for this serializer.

public OutputStream
getOutputStream()

Implements com.sun.org.apache.xml.internal.serializer.Serializer.getOutputStream.

Get the output stream where the events will be serialized to.

public Writer
getWriter()

Implements com.sun.org.apache.xml.internal.serializer.Serializer.getWriter.

Get the character stream where the events will be serialized to.

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

Implements org.xml.sax.ContentHandler.ignorableWhitespace.

Receive notification of ignorable whitespace in element content.

public void
indent(int n)

Does nothing because the indent attribute is ignored for text output.

public void
internalEntityDecl(String arg0, String arg1)

Implements org.xml.sax.ext.DeclHandler.internalEntityDecl.

Report an internal entity declaration.

public void
namespaceAfterStartElement(final String prefix, final String uri)

Overrides com.sun.org.apache.xml.internal.serializer.SerializerBase.namespaceAfterStartElement.

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.namespaceAfterStartElement.

This method is used when a prefix/uri namespace mapping is indicated after the element was started with a startElement() and before and endElement().

public void
public boolean
reset()

Overrides com.sun.org.apache.xml.internal.serializer.ToSAXHandler.reset.

Implements com.sun.org.apache.xml.internal.serializer.Serializer.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).

public void
serialize(Node node)

Implements com.sun.org.apache.xml.internal.serializer.SerializationHandler.serialize.

Notify that the serializer should take this DOM node as input to be serialized.

public void
setDocumentLocator(Locator arg0)

Overrides com.sun.org.apache.xml.internal.serializer.SerializerBase.setDocumentLocator.

Implements org.xml.sax.ContentHandler.setDocumentLocator.

Receive an object for locating the origin of SAX document events.

public boolean
setEscaping(boolean escape)

Implements com.sun.org.apache.xml.internal.serializer.SerializationHandler.setEscaping.

Turns special character escaping on/off.

public void
setIndent(boolean indent)

Overrides com.sun.org.apache.xml.internal.serializer.SerializerBase.setIndent.

Implements com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes.setIndent.

Sets the value coming from the xsl:output indent stylesheet attribute.

public void
setOutputFormat(Properties format)

Implements com.sun.org.apache.xml.internal.serializer.Serializer.setOutputFormat.

Specifies an output format for this serializer.

public void
setOutputStream(OutputStream output)

Implements com.sun.org.apache.xml.internal.serializer.Serializer.setOutputStream.

Specifies an output stream to which the document should be serialized.

public void
setWriter(Writer writer)

Implements com.sun.org.apache.xml.internal.serializer.Serializer.setWriter.

Specifies a writer to which the document should be serialized.

public void
skippedEntity(String arg0)

Implements org.xml.sax.ContentHandler.skippedEntity.

Receive notification of a skipped entity.

public void
startCDATA()

Implements org.xml.sax.ext.LexicalHandler.startCDATA.

Report the start of a CDATA section.

public void
startElement(String arg0, String arg1, String arg2, Attributes arg3)

Overrides com.sun.org.apache.xml.internal.serializer.ToSAXHandler.startElement.

Implements org.xml.sax.ContentHandler.startElement.

Receive notification of the beginning of an element, although this is a SAX method additional namespace or attribute information can occur before or after this call, that is associated with this element.

public void
public void
public void
startEntity(String arg0)

Implements org.xml.sax.ext.LexicalHandler.startEntity.

Report the beginning of some internal and external XML entities.

public boolean
startPrefixMapping(String prefix, String uri, boolean shouldFlush)

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.startPrefixMapping.

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.

public void
startPrefixMapping(String prefix, String uri)

Implements org.xml.sax.ContentHandler.startPrefixMapping.

Begin the scope of a prefix-URI Namespace mapping.

Inherited from com.sun.org.apache.xml.internal.serializer.ToSAXHandler:
addUniqueAttributecharacterscloseCDATAcloseStartTagerrorfatalErrorflushPendinggetShouldOutputNSAttrsetCdataSectionElementssetContentHandlersetLexHandlersetShouldOutputNSAttrsetTransformStatestartDocumentInternalstartDTDwarning

Constructor Detail

ToTextSAXHandlerback to summary
public ToTextSAXHandler(ContentHandler hdlr, LexicalHandler lex, String encoding)
ToTextSAXHandlerback to summary
public ToTextSAXHandler(ContentHandler handler, String encoding)

From XSLTC

Method Detail

addAttributeback to summary
public void addAttribute(String uri, String localName, String rawName, String type, String value, boolean XSLAttribute)

Overrides com.sun.org.apache.xml.internal.serializer.SerializerBase.addAttribute.

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.addAttribute.

Doc from com.sun.org.apache.xml.internal.serializer.SerializerBase.addAttribute.

Adds the given attribute to the set of collected attributes , but only if there is a currently open element. An element is currently open if a startElement() notification has occured but the start of the element has not yet been written to the output. In the stream case this means that we have not yet been forced to close the elements opening tag by another notification, such as a character notification.

See Also
ExtendedContentHandler#addAttribute(String, String, String, String, String)
addAttributeback to summary
public void addAttribute(String name, String value)

Overrides com.sun.org.apache.xml.internal.serializer.SerializerBase.addAttribute.

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.addAttribute.

From XSLTC

attributeDeclback to summary
public void attributeDecl(String arg0, String arg1, String arg2, String arg3, String arg4) throws SAXException

Implements org.xml.sax.ext.DeclHandler.attributeDecl.

Doc from org.xml.sax.ext.DeclHandler.attributeDecl.

Report an attribute type declaration.

Only the effective (first) declaration for an attribute will be reported. The type will be one of the strings "CDATA", "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", a parenthesized token group with the separator "|" and all whitespace removed, or the word "NOTATION" followed by a space followed by a parenthesized token group with all whitespace removed.

The value will be the value as reported to applications, appropriately normalized and with entity and character references expanded.

Exceptions
SAXException:
The application may raise an exception.
See Also
org.xml.sax.ext.DeclHandler#attributeDecl(String, String, String, String, String)
charactersback to summary
public void characters(String characters) throws SAXException

Overrides com.sun.org.apache.xml.internal.serializer.ToSAXHandler.characters.

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.characters.

Doc from com.sun.org.apache.xml.internal.serializer.ToSAXHandler.characters.

Receive notification of character data.

See Also
ExtendedContentHandler#characters(String)
charactersback to summary
public void characters(char[] characters, int offset, int length) throws SAXException

Implements org.xml.sax.ContentHandler.characters.

Doc from org.xml.sax.ContentHandler.characters.

Receive notification of character data.

The Parser will call this method to report each chunk of character data. SAX parsers may return all contiguous character data in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity so that the Locator provides useful information.

The application must not attempt to read from the array outside of the specified range.

Individual characters may consist of more than one Java char value. There are two important cases where this happens, because characters can't be represented in just sixteen bits. In one case, characters are represented in a Surrogate Pair, using two special Unicode values. Such characters are in the so-called "Astral Planes", with a code point above U+FFFF. A second case involves composite characters, such as a base character combining with one or more accent characters.

Your code should not assume that algorithms using char-at-a-time idioms will be working in character units; in some cases they will split characters. This is relevant wherever XML permits arbitrary characters, such as attribute values, processing instruction data, and comments as well as in data reported from this method. It's also generally relevant whenever Java code manipulates internationalized text; the issue isn't unique to XML.

Note that some parsers will report whitespace in element content using the ignorableWhitespace method rather than this one (validating parsers must do so).

Exceptions
SAXException:
any SAX exception, possibly wrapping another exception
See Also
org.xml.sax.ContentHandler#characters(char[], int, int)
commentback to summary
public void comment(char[] ch, int start, int length) throws SAXException

Implements org.xml.sax.ext.LexicalHandler.comment.

Doc from org.xml.sax.ext.LexicalHandler.comment.

Report an XML comment anywhere in the document.

This callback will be used for comments inside or outside the document element, including comments in the external DTD subset (if read). Comments in the DTD must be properly nested inside start/endDTD and start/endEntity events (if used).

Exceptions
SAXException:
The application may raise an exception.
commentback to summary
public void comment(String data) throws SAXException

Overrides com.sun.org.apache.xml.internal.serializer.ToSAXHandler.comment.

Implements com.sun.org.apache.xml.internal.serializer.ExtendedLexicalHandler.comment.

Doc from com.sun.org.apache.xml.internal.serializer.ToSAXHandler.comment.

Receive notification of a comment.

elementDeclback to summary
public void elementDecl(String arg0, String arg1) throws SAXException

Implements org.xml.sax.ext.DeclHandler.elementDecl.

Doc from org.xml.sax.ext.DeclHandler.elementDecl.

Report an element type declaration.

The content model will consist of the string "EMPTY", the string "ANY", or a parenthesised group, optionally followed by an occurrence indicator. The model will be normalized so that all parameter entities are fully resolved and all whitespace is removed, and will include the enclosing parentheses. Other normalization (such as removing redundant parentheses or simplifying occurrence indicators) is at the discretion of the parser.

Exceptions
SAXException:
The application may raise an exception.
See Also
org.xml.sax.ext.DeclHandler#elementDecl(String, String)
endCDATAback to summary
public void endCDATA() throws SAXException

Implements org.xml.sax.ext.LexicalHandler.endCDATA.

Doc from org.xml.sax.ext.LexicalHandler.endCDATA.

Report the end of a CDATA section.

Exceptions
SAXException:
The application may raise an exception.
See Also
org.xml.sax.ext.LexicalHandler#endCDATA()
endDocumentback to summary
public void endDocument() throws SAXException

Implements org.xml.sax.ContentHandler.endDocument.

From XSLTC

Exceptions
SAXException:

Doc from org.xml.sax.ContentHandler.endDocument.

any SAX exception, possibly wrapping another exception

See Also
org.xml.sax.ContentHandler#endDocument()
endDTDback to summary
public void endDTD() throws SAXException

Implements org.xml.sax.ext.LexicalHandler.endDTD.

Doc from org.xml.sax.ext.LexicalHandler.endDTD.

Report the end of DTD declarations.

This method is intended to report the end of the DOCTYPE declaration; if the document has no DOCTYPE declaration, this method will not be invoked.

Exceptions
SAXException:
The application may raise an exception.
See Also
org.xml.sax.ext.LexicalHandler#endDTD()
endElementback to summary
public void endElement(String elemName) throws SAXException

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.endElement.

From XSLTC

See Also
ExtendedContentHandler#endElement(String)
endElementback to summary
public void endElement(String arg0, String arg1, String arg2) throws SAXException

Implements org.xml.sax.ContentHandler.endElement.

Doc from org.xml.sax.ContentHandler.endElement.

Receive notification of the end of an element.

The SAX parser will invoke this method at the end of every element in the XML document; there will be a corresponding startElement event for every endElement event (even when the element is empty).

For information on the names, see startElement.

Exceptions
SAXException:
any SAX exception, possibly wrapping another exception
See Also
org.xml.sax.ContentHandler#endElement(String, String, String)
endPrefixMappingback to summary
public void endPrefixMapping(String arg0) throws SAXException

Implements org.xml.sax.ContentHandler.endPrefixMapping.

Doc from org.xml.sax.ContentHandler.endPrefixMapping.

End the scope of a prefix-URI mapping.

See startPrefixMapping for details. These events will always occur immediately after the corresponding endElement event, but the order of endPrefixMapping events is not otherwise guaranteed.

Exceptions
SAXException:
the client may throw an exception during processing
See Also
org.xml.sax.ContentHandler#endPrefixMapping(String)
externalEntityDeclback to summary
public void externalEntityDecl(String arg0, String arg1, String arg2) throws SAXException

Implements org.xml.sax.ext.DeclHandler.externalEntityDecl.

Doc from org.xml.sax.ext.DeclHandler.externalEntityDecl.

Report a parsed external entity declaration.

Only the effective (first) declaration for each entity will be reported.

If the system identifier is a URL, the parser must resolve it fully before passing it to the application.

Exceptions
SAXException:
The application may raise an exception.
See Also
org.xml.sax.ext.DeclHandler#externalEntityDecl(String, String, String)
getOutputFormatback to summary
public Properties getOutputFormat()

Implements com.sun.org.apache.xml.internal.serializer.Serializer.getOutputFormat.

Doc from com.sun.org.apache.xml.internal.serializer.Serializer.getOutputFormat.

Returns the output format properties for this serializer.

See Also
Serializer#getOutputFormat()
getOutputStreamback to summary
public OutputStream getOutputStream()

Implements com.sun.org.apache.xml.internal.serializer.Serializer.getOutputStream.

Doc from com.sun.org.apache.xml.internal.serializer.Serializer.getOutputStream.

Get the output stream where the events will be serialized to.

See Also
Serializer#getOutputStream()
getWriterback to summary
public Writer getWriter()

Implements com.sun.org.apache.xml.internal.serializer.Serializer.getWriter.

Doc from com.sun.org.apache.xml.internal.serializer.Serializer.getWriter.

Get the character stream where the events will be serialized to.

See Also
Serializer#getWriter()
ignorableWhitespaceback to summary
public void ignorableWhitespace(char[] arg0, int arg1, int arg2) throws SAXException

Implements org.xml.sax.ContentHandler.ignorableWhitespace.

Doc from org.xml.sax.ContentHandler.ignorableWhitespace.

Receive notification of ignorable whitespace in element content.

Validating Parsers must use this method to report each chunk of whitespace in element content (see the W3C XML 1.0 recommendation, section 2.10): non-validating parsers may also use this method if they are capable of parsing and using content models.

SAX parsers may return all contiguous whitespace in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity, so that the Locator provides useful information.

The application must not attempt to read from the array outside of the specified range.

Exceptions
SAXException:
any SAX exception, possibly wrapping another exception
See Also
org.xml.sax.ContentHandler#ignorableWhitespace(char[], int, int)
indentback to summary
public void indent(int n) throws SAXException

Does nothing because the indent attribute is ignored for text output.

internalEntityDeclback to summary
public void internalEntityDecl(String arg0, String arg1) throws SAXException

Implements org.xml.sax.ext.DeclHandler.internalEntityDecl.

Doc from org.xml.sax.ext.DeclHandler.internalEntityDecl.

Report an internal entity declaration.

Only the effective (first) declaration for each entity will be reported. All parameter entities in the value will be expanded, but general entities will not.

Exceptions
SAXException:
The application may raise an exception.
See Also
org.xml.sax.ext.DeclHandler#internalEntityDecl(String, String)
namespaceAfterStartElementback to summary
public void namespaceAfterStartElement(final String prefix, final String uri) throws SAXException

Overrides com.sun.org.apache.xml.internal.serializer.SerializerBase.namespaceAfterStartElement.

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.namespaceAfterStartElement.

Doc from com.sun.org.apache.xml.internal.serializer.SerializerBase.namespaceAfterStartElement.

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.

processingInstructionback to summary
public void processingInstruction(String arg0, String arg1) throws SAXException

Overrides com.sun.org.apache.xml.internal.serializer.ToSAXHandler.processingInstruction.

Implements org.xml.sax.ContentHandler.processingInstruction.

From XSLTC

Exceptions
SAXException:

Doc from org.xml.sax.ContentHandler.processingInstruction.

any SAX exception, possibly wrapping another exception

See Also
org.xml.sax.ContentHandler#processingInstruction(String, String)
resetback to summary
public boolean reset()

Overrides com.sun.org.apache.xml.internal.serializer.ToSAXHandler.reset.

Implements com.sun.org.apache.xml.internal.serializer.Serializer.reset.

Doc from com.sun.org.apache.xml.internal.serializer.ToSAXHandler.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).

See Also
Serializer#reset()
serializeback to summary
public void serialize(Node node) throws IOException

Implements com.sun.org.apache.xml.internal.serializer.SerializationHandler.serialize.

Doc from com.sun.org.apache.xml.internal.serializer.SerializationHandler.serialize.

Notify that the serializer should take this DOM node as input to be serialized.

Exceptions
IOException:

Doc from com.sun.org.apache.xml.internal.serializer.DOMSerializer.serialize.

if an I/O exception occured while serializing

See Also
DOMSerializer#serialize(Node)
setDocumentLocatorback to summary
public void setDocumentLocator(Locator arg0)

Overrides com.sun.org.apache.xml.internal.serializer.SerializerBase.setDocumentLocator.

Implements org.xml.sax.ContentHandler.setDocumentLocator.

Doc from com.sun.org.apache.xml.internal.serializer.SerializerBase.setDocumentLocator.

Receive an object for locating the origin of SAX document events.

See Also
org.xml.sax.ContentHandler#setDocumentLocator(Locator)
setEscapingback to summary
public boolean setEscaping(boolean escape)

Implements com.sun.org.apache.xml.internal.serializer.SerializationHandler.setEscaping.

Doc from com.sun.org.apache.xml.internal.serializer.SerializationHandler.setEscaping.

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.

See Also
SerializationHandler#setEscaping(boolean)
setIndentback to summary
public void setIndent(boolean indent)

Overrides com.sun.org.apache.xml.internal.serializer.SerializerBase.setIndent.

Implements com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes.setIndent.

Doc from com.sun.org.apache.xml.internal.serializer.SerializerBase.setIndent.

Sets the value coming from the xsl:output indent stylesheet attribute.

See Also
SerializationHandler#setIndent(boolean)
setOutputFormatback to summary
public void setOutputFormat(Properties format)

Implements com.sun.org.apache.xml.internal.serializer.Serializer.setOutputFormat.

Doc from com.sun.org.apache.xml.internal.serializer.Serializer.setOutputFormat.

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 href="http://www.w3.org/TR/1999/REC-xslt-19991116"> XSLT 1.0 recommendation</a>

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.

See Also
Serializer#setOutputFormat(Properties)
setOutputStreamback to summary
public void setOutputStream(OutputStream output)

Implements com.sun.org.apache.xml.internal.serializer.Serializer.setOutputStream.

Doc from com.sun.org.apache.xml.internal.serializer.Serializer.setOutputStream.

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.

See Also
Serializer#setOutputStream(OutputStream)
setWriterback to summary
public void setWriter(Writer writer)

Implements com.sun.org.apache.xml.internal.serializer.Serializer.setWriter.

Doc from com.sun.org.apache.xml.internal.serializer.Serializer.setWriter.

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.

See Also
Serializer#setWriter(Writer)
skippedEntityback to summary
public void skippedEntity(String arg0) throws SAXException

Implements org.xml.sax.ContentHandler.skippedEntity.

Doc from org.xml.sax.ContentHandler.skippedEntity.

Receive notification of a skipped entity. This is not called for entity references within markup constructs such as element start tags or markup declarations. (The XML recommendation requires reporting skipped external entities. SAX also reports internal entity expansion/non-expansion, except within markup constructs.)

The Parser will invoke this method each time the entity is skipped. Non-validating processors may skip entities if they have not seen the declarations (because, for example, the entity was declared in an external DTD subset). All processors may skip external entities, depending on the values of the http://xml.org/sax/features/external-general-entities and the http://xml.org/sax/features/external-parameter-entities properties.

Exceptions
SAXException:
any SAX exception, possibly wrapping another exception
See Also
org.xml.sax.ContentHandler#skippedEntity(String)
startCDATAback to summary
public void startCDATA() throws SAXException

Implements org.xml.sax.ext.LexicalHandler.startCDATA.

Doc from org.xml.sax.ext.LexicalHandler.startCDATA.

Report the start of a CDATA section.

The contents of the CDATA section will be reported through the regular characters event; this event is intended only to report the boundary.

Exceptions
SAXException:
The application may raise an exception.
See Also
org.xml.sax.ext.LexicalHandler#startCDATA()
startElementback to summary
public void startElement(String arg0, String arg1, String arg2, Attributes arg3) throws SAXException

Overrides com.sun.org.apache.xml.internal.serializer.ToSAXHandler.startElement.

Implements org.xml.sax.ContentHandler.startElement.

Doc from com.sun.org.apache.xml.internal.serializer.ToSAXHandler.startElement.

Receive notification of the beginning of an element, although this is a SAX method additional namespace or attribute information can occur before or after this call, that is associated with this element.

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
See Also
org.xml.sax.ContentHandler#startElement(String, String, String, Attributes)
startElementback to summary
public void startElement(String elementNamespaceURI, String elementLocalName, String elementName) throws SAXException

Overrides com.sun.org.apache.xml.internal.serializer.ToSAXHandler.startElement.

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.startElement.

From XSLTC

See Also
ExtendedContentHandler#startElement(String)
startElementback to summary
public void startElement(String elementName) throws SAXException

Overrides com.sun.org.apache.xml.internal.serializer.ToSAXHandler.startElement.

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.startElement.

Doc from com.sun.org.apache.xml.internal.serializer.ToSAXHandler.startElement.

An element starts, but attributes are not fully known yet.

startEntityback to summary
public void startEntity(String arg0) throws SAXException

Implements org.xml.sax.ext.LexicalHandler.startEntity.

Doc from org.xml.sax.ext.LexicalHandler.startEntity.

Report the beginning of some internal and external XML entities.

The reporting of parameter entities (including the external DTD subset) is optional, and SAX2 drivers that report LexicalHandler events may not implement it; you can use the http://xml.org/sax/features/lexical-handler/parameter-entities feature to query or control the reporting of parameter entities.

General entities are reported with their regular names, parameter entities have '%' prepended to their names, and the external DTD subset has the pseudo-entity name "[dtd]".

When a SAX2 driver is providing these events, all other events must be properly nested within start/end entity events. There is no additional requirement that events from DeclHandler or DTDHandler be properly ordered.

Note that skipped entities will be reported through the skippedEntity event, which is part of the ContentHandler interface.

Because of the streaming event model that SAX uses, some entity boundaries cannot be reported under any circumstances:

  • general entities within attribute values
  • parameter entities within declarations

These will be silently expanded, with no indication of where the original entity boundaries were.

Note also that the boundaries of character references (which are not really entities anyway) are not reported.

All start/endEntity events must be properly nested.

Exceptions
SAXException:
The application may raise an exception.
See Also
org.xml.sax.ext.LexicalHandler#startEntity(String)
startPrefixMappingback to summary
public boolean startPrefixMapping(String prefix, String uri, boolean shouldFlush) throws SAXException

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.startPrefixMapping.

Doc from com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.startPrefixMapping.

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.

startPrefixMappingback to summary
public void startPrefixMapping(String prefix, String uri) throws SAXException

Implements org.xml.sax.ContentHandler.startPrefixMapping.

Doc from org.xml.sax.ContentHandler.startPrefixMapping.

Begin the scope of a prefix-URI Namespace mapping.

The information from this event is not necessary for normal Namespace processing: the SAX XML reader will automatically replace prefixes for element and attribute names when the http://xml.org/sax/features/namespaces feature is true (the default).

There are cases, however, when applications need to use prefixes in character data or in attribute values, where they cannot safely be expanded automatically; the start/endPrefixMapping event supplies the information to the application to expand prefixes in those contexts itself, if necessary.

Note that start/endPrefixMapping events are not guaranteed to be properly nested relative to each other: all startPrefixMapping events will occur immediately before the corresponding startElement event, and all endPrefixMapping events will occur immediately after the corresponding endElement event, but their order is not otherwise guaranteed.

There should never be start/endPrefixMapping events for the "xml" prefix, since it is predeclared and immutable.

Exceptions
SAXException:
the client may throw an exception during processing