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

public final Class ToHTMLSAXHandler

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

This class accepts SAX-like calls, then sends true SAX calls to a wrapped SAX handler. There is optimization done knowing that the ultimate output is HTML. This class is not a public API.

Field Summary

Modifier and TypeField and Description
private boolean
m_dtdHandled

Handle document type declaration (for first element only)

protected boolean
m_escapeSetting

Keeps track of whether output escaping is currently enabled

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

Constructor Summary

AccessConstructor and Description
public
ToHTMLSAXHandler(ContentHandler
the wrapped SAX content handler
handler
,
String
the encoding of the output HTML document
encoding
)

A constructor

public
ToHTMLSAXHandler(ContentHandler
the wrapped SAX content handler
handler
,
LexicalHandler
the wrapped lexical handler
lex
,
String
the encoding of the output HTML document
encoding
)

A constructor.

Method Summary

Modifier and TypeMethod and Description
public void
attributeDecl(String
this parameter is ignored
eName
,
String
this parameter is ignored
aName
,
String
this parameter is ignored
type
,
String
this parameter is ignored
valueDefault
,
String
this parameter is ignored
value
)

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

Does nothing.

public void
characters(final String
The string of characters to process.
chars
)

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

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

Receive notification of character data.

public void
characters(char[]
The characters from the XML document.
ch
,
int
The start position in the array.
off
,
int
The number of characters to read from the array.
len
)

Implements org.xml.sax.ContentHandler.characters.

Receive notification of character data.

public void
protected void
closeStartTag()

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

This method is called when all the data needed for a call to the SAX handler's startElement() method has been gathered.

public void
comment(char[]
An array holding the characters in the comment.
ch
,
int
The starting position in the array.
start
,
int
The number of characters to use from the array.
length
)

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

Receive notification of a comment anywhere in the document.

public void
elementDecl(String name, String model)

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

Does nothing.

public void
public void
endDocument()

Implements org.xml.sax.ContentHandler.endDocument.

Receive notification of the end of a document.

public void
endDTD()

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

Does nothing.

public void
endElement(String
The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
uri
,
String
The local name (without prefix), or the empty string if Namespace processing is not being performed.
localName
,
String
The qualified name (with prefix), or the empty string if qualified names are not available.
qName
)

Implements org.xml.sax.ContentHandler.endElement.

Receive notification of the end of an element.

public void
endElement(String
The element type name
elementName
)

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

Receive notification of the end of an element.

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

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

Report a parsed external entity declaration.

public void
flushPending()

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

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

This method flushes any pending events, which can be startDocument() closing the opening tag of an element, or closing an open CDATA section.

public Properties
public OutputStream
public Writer
public void
ignorableWhitespace(char[] ch, int start, int length)

Implements org.xml.sax.ContentHandler.ignorableWhitespace.

Does nothing.

public void
indent(int n)

Does nothing.

public void
public void
namespaceAfterStartElement(final String
the prefix associated with the given URI.
prefix
,
final String
the URI of the namespace
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
processingInstruction(String
The processing instruction target.
target
,
String
The processing instruction data, or null if none was supplied.
data
)

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

Implements org.xml.sax.ContentHandler.processingInstruction.

Receive notification of a processing instruction.

public boolean

Returns:

true if the class was successfuly reset.
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).

private void
resetToHTMLSAXHandler()

Reset all of the fields owned by ToHTMLSAXHandler class

public void
public void
public boolean
setEscaping(boolean
true if escaping is to be set on.
escape
)

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

Turns special character escaping on/off.

public void
setIndent(boolean
the number of spaces to indent per indentation level (ignored)
indent
)

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

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

Does nothing

public void
public void
public void
setWriter(Writer
this parameter is ignored.
writer
)

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

Does nothing.

public void
public void
public void
startElement(String
The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
namespaceURI
,
String
The local name (without prefix), or the empty string if Namespace processing is not being performed.
localName
,
String
The elements name.
qName
,
Attributes
The attributes attached to the element, if any.
atts
)

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
startElement(String
the URI of the namespace of the element (optional)
elementNamespaceURI
,
String
the element name, but without prefix (optional)
elementLocalName
,
String
the element name, with prefix, if any (required)
elementName
)

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

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

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

public void
startElement(String
the element name, with prefix, if any
elementName
)

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

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

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

public void
public boolean

Returns:

returns true if the call made a change to the current namespace information, false if it did not change anything, e.g. if the prefix/namespace mapping was already in scope from before.
startPrefixMapping
(String
The Namespace prefix being declared.
prefix
,
String
The Namespace URI the prefix is mapped to.
uri
,
boolean
true if any open tags need to be closed first, this will impact which element the mapping applies to (open parent, or its up comming child)
shouldFlush
)

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

Handle a prefix/uri mapping, which is associated with a startElement() that is soon to follow.

public void
startPrefixMapping(String
The Namespace prefix being declared.
prefix
,
String
The Namespace URI the prefix is mapped to.
uri
)

Implements org.xml.sax.ContentHandler.startPrefixMapping.

Begin the scope of a prefix-URI Namespace mapping just before another element is about to start.

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

Field Detail

m_dtdHandledback to summary
private boolean m_dtdHandled

Handle document type declaration (for first element only)

m_escapeSettingback to summary
protected boolean m_escapeSetting

Keeps track of whether output escaping is currently enabled

Constructor Detail

ToHTMLSAXHandlerback to summary
public ToHTMLSAXHandler(ContentHandler handler, String encoding)

A constructor

Parameters
handler:ContentHandler

the wrapped SAX content handler

encoding:String

the encoding of the output HTML document

ToHTMLSAXHandlerback to summary
public ToHTMLSAXHandler(ContentHandler handler, LexicalHandler lex, String encoding)

A constructor.

Parameters
handler:ContentHandler

the wrapped SAX content handler

lex:LexicalHandler

the wrapped lexical handler

encoding:String

the encoding of the output HTML document

Method Detail

attributeDeclback to summary
public void attributeDecl(String eName, String aName, String type, String valueDefault, String value) throws SAXException

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

Does nothing.

Parameters
eName:String

this parameter is ignored

aName:String

this parameter is ignored

type:String

this parameter is ignored

valueDefault:String

this parameter is ignored

value:String

this parameter is ignored

Exceptions
SAXException:

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

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(final String chars) throws SAXException

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

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

Receive notification of character data.

Parameters
chars:String

The string of characters to process.

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

Implements 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.

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

Parameters
ch:char[]

The characters from the XML document.

off:int

The start position in the array.

len:int

The number of characters to read from the array.

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
See Also
ignorableWhitespace, org.xml.sax.Locator, org.xml.sax.ContentHandler#characters(char[], int, int)
closeback to summary
public void close()

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

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

Do nothing.

See Also
SerializationHandler#close()
closeStartTagback to summary
protected void closeStartTag() throws SAXException

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

This method is called when all the data needed for a call to the SAX handler's startElement() method has been gathered.

commentback to summary
public void comment(char[] ch, int start, int length) throws SAXException

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

Receive notification of a comment anywhere in the document. This callback will be used for comments inside or outside the document element.

Parameters
ch:char[]

An array holding the characters in the comment.

start:int

The starting position in the array.

length:int

The number of characters to use from the array.

Exceptions
SAXException:
The application may raise an exception.
See Also
org.xml.sax.ext.LexicalHandler#comment(char[], int, int)
elementDeclback to summary
public void elementDecl(String name, String model) throws SAXException

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

Does nothing.

Exceptions
SAXException:

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

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.

Does nothing.

Exceptions
SAXException:

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

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.

Receive notification of the end of a document.

The SAX parser will invoke this method only once, and it will be the last method invoked during the parse. The parser shall not invoke this method until it has either abandoned parsing (because of an unrecoverable error) or reached the end of input.

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
endDTDback to summary
public void endDTD() throws SAXException

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

Does nothing.

Exceptions
SAXException:

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

The application may raise an exception.

See Also
org.xml.sax.ext.LexicalHandler#endDTD()
endElementback to summary
public void endElement(String uri, String localName, String qName) throws SAXException

Implements 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).

If the element name has a namespace prefix, the prefix will still be attached to the name.

Parameters
uri:String

The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.

localName:String

The local name (without prefix), or the empty string if Namespace processing is not being performed.

qName:String

The qualified name (with prefix), or the empty string if qualified names are not available.

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
See Also
org.xml.sax.ContentHandler#endElement(String, String, String)
endElementback to summary
public void endElement(String elementName) throws SAXException

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

Receive notification of the end of an element.

Parameters
elementName:String

The element type name

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
See Also
ExtendedContentHandler#endElement(String)
endPrefixMappingback to summary
public void endPrefixMapping(String prefix) throws SAXException

Implements org.xml.sax.ContentHandler.endPrefixMapping.

Does nothing.

Exceptions
SAXException:

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

the client may throw an exception during processing

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)
flushPendingback to summary
public void flushPending() throws SAXException

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

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

This method flushes any pending events, which can be startDocument() closing the opening tag of an element, or closing an open CDATA section.

getOutputFormatback to summary
public Properties getOutputFormat()

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

Returns null.

Returns:Properties

null

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

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

Reurns null

Returns:OutputStream

null

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

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

Returns null

Returns:Writer

null

See Also
Serializer#getWriter()
ignorableWhitespaceback to summary
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException

Implements org.xml.sax.ContentHandler.ignorableWhitespace.

Does nothing.

Exceptions
SAXException:

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

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.

internalEntityDeclback to summary
public void internalEntityDecl(String name, String value) throws SAXException

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

Does nothing.

Exceptions
SAXException:

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

The application may raise an exception.

See Also
org.xml.sax.DTDHandler#unparsedEntityDecl
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.

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.

Parameters
prefix:String

the prefix associated with the given URI.

uri:String

the URI of the namespace

See Also
ExtendedContentHandler#namespaceAfterStartElement(String, String)
processingInstructionback to summary
public void processingInstruction(String target, String data) throws SAXException

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

Implements org.xml.sax.ContentHandler.processingInstruction.

Receive notification of a processing instruction.

The Parser will invoke this method once for each processing instruction found: note that processing instructions may occur before or after the main document element.

A SAX parser should never report an XML declaration (XML 1.0, section 2.8) or a text declaration (XML 1.0, section 4.3.1) using this method.

Parameters
target:String

The processing instruction target.

data:String

The processing instruction data, or null if none was supplied.

Exceptions
SAXException:
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.

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

Returns:boolean

true if the class was successfuly reset.

See Also
Serializer#reset()
resetToHTMLSAXHandlerback to summary
private void resetToHTMLSAXHandler()

Reset all of the fields owned by ToHTMLSAXHandler class

serializeback to summary
public void serialize(Node node) throws IOException

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

Does nothing.

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.

Does nothing.

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

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

Turns special character escaping on/off.

Parameters
escape:boolean

true if escaping is to be set on.

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.

Does nothing

Parameters
indent:boolean

the number of spaces to indent per indentation level (ignored)

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

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

Does nothing.

Parameters
format:Properties

this parameter is not used

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

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

Does nothing.

Parameters
output:OutputStream

this parameter is ignored

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

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

Does nothing.

Parameters
writer:Writer

this parameter is ignored.

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

Implements org.xml.sax.ContentHandler.skippedEntity.

Does nothing.

Exceptions
SAXException:

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

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.

Does nothing.

Exceptions
SAXException:

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

The application may raise an exception.

See Also
org.xml.sax.ext.LexicalHandler#startCDATA()
startElementback to summary
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException

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.

Parameters
namespaceURI:String

The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.

localName:String

The local name (without prefix), or the empty string if Namespace processing is not being performed.

qName:String

The elements name.

atts:Attributes

The attributes attached to the element, if any.

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
See Also
org.xml.sax.ContentHandler#startElement, org.xml.sax.ContentHandler#endElement, org.xml.sax.AttributeList, 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.

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

Parameters
elementNamespaceURI:String

the URI of the namespace of the element (optional)

elementLocalName:String

the element name, but without prefix (optional)

elementName:String

the element name, with prefix, if any (required)

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.

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

Parameters
elementName:String

the element name, with prefix, if any

See Also
ExtendedContentHandler#startElement(String)
startEntityback to summary
public void startEntity(String arg0) throws SAXException

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

Does nothing.

Exceptions
SAXException:

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

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.

Handle a prefix/uri mapping, which is associated with a startElement() that is soon to follow. Need to close any open start tag to make sure than any name space attributes due to this event are associated wih the up comming element, not the current one.

Parameters
prefix:String

The Namespace prefix being declared.

uri:String

The Namespace URI the prefix is mapped to.

shouldFlush:boolean

true if any open tags need to be closed first, this will impact which element the mapping applies to (open parent, or its up comming child)

Returns:boolean

returns true if the call made a change to the current namespace information, false if it did not change anything, e.g. if the prefix/namespace mapping was already in scope from before.

Exceptions
SAXException:
The client may throw an exception during processing.
See Also
ExtendedContentHandler#startPrefixMapping
startPrefixMappingback to summary
public void startPrefixMapping(String prefix, String uri) throws SAXException

Implements org.xml.sax.ContentHandler.startPrefixMapping.

Begin the scope of a prefix-URI Namespace mapping just before another element is about to start. This call will close any open tags so that the prefix mapping will not apply to the current element, but the up comming child.

Parameters
prefix:String

The Namespace prefix being declared.

uri:String

The Namespace URI the prefix is mapped to.

Exceptions
SAXException:
The client may throw an exception during processing.
See Also
org.xml.sax.ContentHandler#startPrefixMapping