org.apache.xml.serializer
Class ToHTMLStream

java.lang.Object
  extended by org.apache.xml.serializer.SerializerBase
      extended by org.apache.xml.serializer.ToStream
          extended by org.apache.xml.serializer.ToHTMLStream
All Implemented Interfaces:
DOMSerializer, ExtendedContentHandler, ExtendedLexicalHandler, SerializationHandler, Serializer, SerializerConstants, XSLOutputAttributes, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.ErrorHandler, org.xml.sax.ext.DeclHandler, org.xml.sax.ext.LexicalHandler

public class ToHTMLStream
extends ToStream

This serializer takes a series of SAX or SAX-like events and writes its output to the given stream. This class is not a public API, it is public because it is used from another package.


Nested Class Summary
(package private) static class ToHTMLStream.Trie
           
 
Nested classes/interfaces inherited from class org.apache.xml.serializer.ToStream
ToStream.BoolStack
 
Field Summary
private static ElemDesc m_dummy
          Dummy element for elements not found.
(package private) static ToHTMLStream.Trie m_elementFlags
          A digital search trie for fast, case insensitive lookup of ElemDesc objects.
private  CharInfo m_htmlcharInfo
          Map that tells which XML characters should have special treatment, and it provides character to entity name lookup.
private  ToHTMLStream.Trie m_htmlInfo
          A Trie that is just a copy of the "static" one.
private  boolean m_inBlockElem
          True if the current element is a block element.
protected  boolean m_inDTD
          This flag is set while receiving events from the DTD
private  boolean m_omitMetaTag
          True if the META tag should be omitted.
private  boolean m_specialEscapeURLs
          True if URLs should be specially escaped with the %xx form.
 
Fields inherited from class org.apache.xml.serializer.ToStream
m_cdataStartCalled, m_charInfo, m_disableOutputEscapingStates, m_encodingInfo, m_escaping, m_inDoctype, m_ispreserve, m_isprevtext, m_isUTF8, m_lineSep, m_lineSepLen, m_lineSepUse, m_outputStream, m_preserves, m_shouldFlush, m_spaceBeforeClose, m_startNewLine
 
Fields inherited from class org.apache.xml.serializer.SerializerBase
m_attrBuff, m_attributes, m_CdataElems, m_cdataTagOpen, m_charsBuff, m_docIsEmpty, m_doctypePublic, m_doctypeSystem, m_doIndent, m_elemContext, m_indentAmount, m_inEntityRef, m_inExternalDTD, m_mediatype, m_needToCallStartDocument, m_needToOutputDocTypeDecl, m_prefixMap, m_shouldNotWriteXMLHeader, m_sourceLocator, m_standaloneWasSpecified, m_StringOfCDATASections, m_tracer, m_version, m_writer, PKG_NAME, PKG_PATH
 
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
CDATA_CONTINUE, CDATA_DELIMITER_CLOSE, CDATA_DELIMITER_OPEN, DEFAULT_SAX_SERIALIZER, EMPTYSTRING, ENTITY_AMP, ENTITY_CRLF, ENTITY_GT, ENTITY_LT, ENTITY_QUOT, XML_PREFIX, XMLNS_PREFIX, XMLNS_URI, XMLVERSION10, XMLVERSION11
 
Constructor Summary
ToHTMLStream()
          Default constructor.
 
Method Summary
 void addUniqueAttribute(java.lang.String name, java.lang.String value, int flags)
          This method is used to add an attribute to the currently open element.
 void attributeDecl(java.lang.String eName, java.lang.String aName, java.lang.String type, java.lang.String valueDefault, java.lang.String value)
          This method does nothing.
 void cdata(char[] ch, int start, int length)
          Receive notification of cdata.
 void characters(char[] chars, int start, int length)
          Receive notification of character data.
protected  void closeStartTag()
          For the enclosing elements starting tag write out out any attributes followed by ">".
 void comment(char[] ch, int start, int length)
          Receive notification of an XML comment anywhere in the document.
 void elementDecl(java.lang.String name, java.lang.String model)
          This method does nothing.
 void endDocument()
          Receive notification of the end of a document.
 void endDTD()
          Report the end of DTD declarations.
 void endElement(java.lang.String elemName)
          Receive notification of the end of an element.
 void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String name)
          Receive notification of the end of an element.
 void entityReference(java.lang.String name)
          Receive notivication of a entityReference.
 void externalEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
          This method does nothing.
static ElemDesc getElemDesc(java.lang.String name)
          Get a description of the given element.
private  ElemDesc getElemDesc2(java.lang.String name)
          Calls to this method could be replaced with calls to getElemDesc(name), but this one should be faster.
private  boolean getOmitMetaTag()
          Tells if the formatter should omit the META tag.
private  boolean getSpecialEscapeURLs()
          Tells if the formatter should use special URL escaping.
(package private) static void initTagReference(ToHTMLStream.Trie m_elementFlags)
           
 void internalEntityDecl(java.lang.String name, java.lang.String value)
          This method does nothing.
private  boolean isASCIIDigit(char c)
          Tell if a character is an ASCII digit.
private  boolean isHHSign(java.lang.String str)
          Dmitri Ilyin: Makes sure if the String is HH encoded sign.
private static java.lang.String makeHHString(int i)
          Make an integer into an HH hex value.
 void namespaceAfterStartElement(java.lang.String prefix, java.lang.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().
private  void outputDocTypeDecl(java.lang.String name)
          This method should only get called once.
protected  void processAttribute(java.io.Writer writer, java.lang.String name, java.lang.String value, ElemDesc elemDesc)
          Process an attribute.
 void processAttributes(java.io.Writer writer, int nAttrs)
          Process the attributes, which means to write out the currently collected attributes to the writer.
 void processingInstruction(java.lang.String target, java.lang.String data)
          Receive notification of a processing instruction.
 boolean reset()
          Try's to reset the super class and reset this class for re-use, so that you don't need to create a new serializer (mostly for performance reasons).
private  void resetToHTMLStream()
           
 void setOmitMetaTag(boolean bool)
          Tells if the formatter should omit the META tag.
 void setOutputFormat(java.util.Properties format)
          Specifies an output format for this serializer.
 void setSpecialEscapeURLs(boolean bool)
          Tells if the formatter should use special URL escaping.
protected  void startDocumentInternal()
          Receive notification of the beginning of a document.
 void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
          Report the start of DTD declarations, if any.
 void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String name, org.xml.sax.Attributes atts)
          Receive notification of the beginning of an element.
 void writeAttrString(java.io.Writer writer, java.lang.String string, java.lang.String encoding)
          Writes the specified string after substituting specials, and UTF-16 surrogates for character references &#xnn.
 void writeAttrURI(java.io.Writer writer, java.lang.String string, boolean doURLEscaping)
          Write the specified string after substituting non ASCII characters, with %HH, where HH is the hex of the byte value.
 
Methods inherited from class org.apache.xml.serializer.ToStream
accumDefaultEntity, addAttributeAlways, addCdataSectionElements, characters, charactersRaw, closeCDATA, endCDATA, endNonEscaping, endPrefixMapping, ensureAttributesNamespaceIsDeclared, ensurePrefixIsDeclared, escapingNotNeeded, firePseudoAttributes, flushPending, flushWriter, getIndentAmount, getOutputFormat, getOutputStream, getWriter, ignorableWhitespace, indent, indent, notationDecl, outputDocTypeDecl, outputEntityDecl, outputLineSep, serialize, setCdataSectionElements, setContentHandler, setDTDEntityExpansion, setEncoding, setEscaping, setIndentAmount, setLineSepUse, setNewLine, setOutputStream, setProp, setTransformer, setWriter, shouldIndent, skippedEntity, startCDATA, startElement, startElement, startEntity, startNonEscaping, startPrefixMapping, startPrefixMapping, unparsedEntityDecl, writeNormalizedChars, writeUTF16Surrogate
 
Methods inherited from class org.apache.xml.serializer.SerializerBase
addAttribute, addAttribute, addAttribute, addAttributes, addXSLAttribute, asContentHandler, asDOM3Serializer, asDOMSerializer, characters, close, comment, documentIsEmpty, endEntity, error, fatalError, fireCDATAEvent, fireCharEvent, fireCommentEvent, fireEndDoc, fireEndElem, fireEndEntity, fireEntityReference, fireEscapingEvent, fireStartDoc, fireStartElem, fireStartEntity, getDoctypePublic, getDoctypeSystem, getEncoding, getFirstCharLocName, getIndent, getLocalName, getMediaType, getNamespaceMappings, getNamespaceURI, getNamespaceURIFromPrefix, getOmitXMLDeclaration, getOutputPropDefaultKeys, getOutputProperty, getOutputPropertyDefault, getOutputPropertyNonDefault, getOutputPropKeys, getPrefix, getPrefixPart, getStandalone, getTransformer, getVersion, initCDATA, initCdataElems, inTemporaryOutputState, isCdataSection, patchName, setDoctype, setDoctypePublic, setDoctypeSystem, setDocumentLocator, setIndent, setMediaType, setNamespaceMappings, setOmitXMLDeclaration, setOutputProperty, setOutputPropertyDefault, setSourceLocator, setStandalone, setStandaloneInternal, setVersion, startDocument, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_inDTD

protected boolean m_inDTD
This flag is set while receiving events from the DTD


m_inBlockElem

private boolean m_inBlockElem
True if the current element is a block element. (seems like this needs to be a stack. -sb).


m_htmlcharInfo

private final CharInfo m_htmlcharInfo
Map that tells which XML characters should have special treatment, and it provides character to entity name lookup.


m_elementFlags

static final ToHTMLStream.Trie m_elementFlags
A digital search trie for fast, case insensitive lookup of ElemDesc objects.


m_dummy

private static final ElemDesc m_dummy
Dummy element for elements not found.


m_specialEscapeURLs

private boolean m_specialEscapeURLs
True if URLs should be specially escaped with the %xx form.


m_omitMetaTag

private boolean m_omitMetaTag
True if the META tag should be omitted.


m_htmlInfo

private ToHTMLStream.Trie m_htmlInfo
A Trie that is just a copy of the "static" one. We need this one to be able to use the faster, but not thread-safe method Trie.get2(name)

Constructor Detail

ToHTMLStream

public ToHTMLStream()
Default constructor.

Method Detail

initTagReference

static void initTagReference(ToHTMLStream.Trie m_elementFlags)

setSpecialEscapeURLs

public void setSpecialEscapeURLs(boolean bool)
Tells if the formatter should use special URL escaping.

Parameters:
bool - True if URLs should be specially escaped with the %xx form.

setOmitMetaTag

public void setOmitMetaTag(boolean bool)
Tells if the formatter should omit the META tag.

Parameters:
bool - True if the META tag should be omitted.

setOutputFormat

public void setOutputFormat(java.util.Properties format)
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. This method can be called multiple times before starting the serialization of a particular result-tree. In principle all serialization parameters can be changed, with the exception of method="html" (it must be method="html" otherwise we shouldn't even have a ToHTMLStream object here!)

Specified by:
setOutputFormat in interface Serializer
Overrides:
setOutputFormat in class ToStream
Parameters:
format - The output format or serialzation parameters to use.

getSpecialEscapeURLs

private final boolean getSpecialEscapeURLs()
Tells if the formatter should use special URL escaping.

Returns:
True if URLs should be specially escaped with the %xx form.

getOmitMetaTag

private final boolean getOmitMetaTag()
Tells if the formatter should omit the META tag.

Returns:
True if the META tag should be omitted.

getElemDesc

public static final ElemDesc getElemDesc(java.lang.String name)
Get a description of the given element.

Parameters:
name - non-null name of element, case insensitive.
Returns:
non-null reference to ElemDesc, which may be m_dummy if no element description matches the given name.

getElemDesc2

private ElemDesc getElemDesc2(java.lang.String name)
Calls to this method could be replaced with calls to getElemDesc(name), but this one should be faster.


startDocumentInternal

protected void startDocumentInternal()
                              throws org.xml.sax.SAXException
Receive notification of the beginning of a document.

Overrides:
startDocumentInternal in class SerializerBase
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
org.xml.sax.SAXException

outputDocTypeDecl

private void outputDocTypeDecl(java.lang.String name)
                        throws org.xml.sax.SAXException
This method should only get called once. If a DOCTYPE declaration needs to get written out, it will be written out. If it doesn't need to be written out, then the call to this method has no effect.

Throws:
org.xml.sax.SAXException

endDocument

public final void endDocument()
                       throws org.xml.sax.SAXException
Receive notification of the end of a document.

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

startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String localName,
                         java.lang.String name,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
Receive notification of the beginning of an element.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class ToStream
Parameters:
namespaceURI -
localName -
name - The element type name.
atts - The attributes attached to the element, if any.
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
endElement(java.lang.String, java.lang.String, java.lang.String), AttributeList

endElement

public final void endElement(java.lang.String namespaceURI,
                             java.lang.String localName,
                             java.lang.String name)
                      throws org.xml.sax.SAXException
Receive notification of the end of an element.

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class ToStream
Parameters:
namespaceURI -
localName -
name - The element type name
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

processAttribute

protected void processAttribute(java.io.Writer writer,
                                java.lang.String name,
                                java.lang.String value,
                                ElemDesc elemDesc)
                         throws java.io.IOException
Process an attribute.

Parameters:
writer - The writer to write the processed output to.
name - The name of the attribute.
value - The value of the attribute.
elemDesc - The description of the HTML element that has this attribute.
Throws:
org.xml.sax.SAXException
java.io.IOException

isASCIIDigit

private boolean isASCIIDigit(char c)
Tell if a character is an ASCII digit.


makeHHString

private static java.lang.String makeHHString(int i)
Make an integer into an HH hex value. Does no checking on the size of the input, since this is only meant to be used locally by writeAttrURI.

Parameters:
i - must be a value less than 255.
Returns:
should be a two character string.

isHHSign

private boolean isHHSign(java.lang.String str)
Dmitri Ilyin: Makes sure if the String is HH encoded sign.

Parameters:
str - must be 2 characters long
Returns:
true or false

writeAttrURI

public void writeAttrURI(java.io.Writer writer,
                         java.lang.String string,
                         boolean doURLEscaping)
                  throws java.io.IOException
Write the specified string after substituting non ASCII characters, with %HH, where HH is the hex of the byte value.

Parameters:
string - String to convert to XML format.
doURLEscaping - True if we should try to encode as per http://www.ietf.org/rfc/rfc2396.txt.
Throws:
org.xml.sax.SAXException - if a bad surrogate pair is detected.
java.io.IOException

writeAttrString

public void writeAttrString(java.io.Writer writer,
                            java.lang.String string,
                            java.lang.String encoding)
                     throws java.io.IOException
Writes the specified string after substituting specials, and UTF-16 surrogates for character references &#xnn.

Overrides:
writeAttrString in class ToStream
Parameters:
string - String to convert to XML format.
encoding - CURRENTLY NOT IMPLEMENTED.
Throws:
org.xml.sax.SAXException
java.io.IOException

characters

public final void characters(char[] chars,
                             int start,
                             int length)
                      throws org.xml.sax.SAXException
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).

Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class ToStream
Parameters:
chars - The characters from the XML document.
start - The start position in the array.
length - The number of characters to read from the array.
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
org.xml.sax.SAXException
See Also:
ToStream.ignorableWhitespace(char[], int, int), Locator

cdata

public final void cdata(char[] ch,
                        int start,
                        int length)
                 throws org.xml.sax.SAXException
Receive notification of cdata.

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

Overrides:
cdata in class ToStream
Parameters:
ch - The characters from the XML document.
start - The start position in the array.
length - The number of characters to read from the array.
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
org.xml.sax.SAXException
See Also:
ToStream.ignorableWhitespace(char[], int, int), Locator

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws org.xml.sax.SAXException
Receive notification of a processing instruction.

Parameters:
target - The processing instruction target.
data - The processing instruction data, or null if none was supplied.
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
org.xml.sax.SAXException

entityReference

public final void entityReference(java.lang.String name)
                           throws org.xml.sax.SAXException
Receive notivication of a entityReference.

Specified by:
entityReference in interface ExtendedContentHandler
Overrides:
entityReference in class SerializerBase
Parameters:
name - non-null reference to entity name string.
Throws:
org.xml.sax.SAXException

endElement

public final void endElement(java.lang.String elemName)
                      throws org.xml.sax.SAXException
Description copied from class: ToStream
Receive notification of the end of an element.

Specified by:
endElement in interface ExtendedContentHandler
Overrides:
endElement in class ToStream
Parameters:
elemName - The element type name
Throws:
org.xml.sax.SAXException
See Also:
ExtendedContentHandler.endElement(String)

processAttributes

public void processAttributes(java.io.Writer writer,
                              int nAttrs)
                       throws java.io.IOException,
                              org.xml.sax.SAXException
Process the attributes, which means to write out the currently collected attributes to the writer. The attributes are not cleared by this method

Overrides:
processAttributes in class ToStream
Parameters:
writer - the writer to write processed attributes to.
nAttrs - the number of attributes in m_attributes to be processed
Throws:
org.xml.sax.SAXException
java.io.IOException

closeStartTag

protected void closeStartTag()
                      throws org.xml.sax.SAXException
For the enclosing elements starting tag write out out any attributes followed by ">". At this point we also mark if this element is a cdata-section-element.

Overrides:
closeStartTag in class ToStream
Throws:
org.xml.sax.SAXException

namespaceAfterStartElement

public void namespaceAfterStartElement(java.lang.String prefix,
                                       java.lang.String uri)
                                throws org.xml.sax.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 class SerializerBase
Parameters:
uri - the URI of the namespace
prefix - the prefix associated with the given URI.
Throws:
org.xml.sax.SAXException
See Also:
ExtendedContentHandler.namespaceAfterStartElement(String, String)

startDTD

public void startDTD(java.lang.String name,
                     java.lang.String publicId,
                     java.lang.String systemId)
              throws org.xml.sax.SAXException
Description copied from class: ToStream
Report the start of DTD declarations, if any. Any declarations are assumed to be in the internal subset unless otherwise indicated.

Specified by:
startDTD in interface org.xml.sax.ext.LexicalHandler
Overrides:
startDTD in class ToStream
Parameters:
name - The document type name.
publicId - The declared public identifier for the external DTD subset, or null if none was declared.
systemId - The declared system identifier for the external DTD subset, or null if none was declared.
Throws:
org.xml.sax.SAXException - The application may raise an exception.
See Also:
ToStream.endDTD(), ToStream.startEntity(java.lang.String)

endDTD

public void endDTD()
            throws org.xml.sax.SAXException
Report the end of DTD declarations.

Specified by:
endDTD in interface org.xml.sax.ext.LexicalHandler
Overrides:
endDTD in class ToStream
Throws:
org.xml.sax.SAXException - The application may raise an exception.
See Also:
startDTD(java.lang.String, java.lang.String, java.lang.String)

attributeDecl

public void attributeDecl(java.lang.String eName,
                          java.lang.String aName,
                          java.lang.String type,
                          java.lang.String valueDefault,
                          java.lang.String value)
                   throws org.xml.sax.SAXException
This method does nothing.

Specified by:
attributeDecl in interface org.xml.sax.ext.DeclHandler
Overrides:
attributeDecl in class ToStream
Parameters:
eName - The name of the associated element.
aName - The name of the attribute.
type - A string representing the attribute type.
valueDefault - A string representing the attribute default ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if none of these applies.
value - A string representing the attribute's default value, or null if there is none.
Throws:
org.xml.sax.SAXException - The application may raise an exception.

elementDecl

public void elementDecl(java.lang.String name,
                        java.lang.String model)
                 throws org.xml.sax.SAXException
This method does nothing.

Specified by:
elementDecl in interface org.xml.sax.ext.DeclHandler
Overrides:
elementDecl in class ToStream
Parameters:
name - The element type name.
model - The content model as a normalized string.
Throws:
org.xml.sax.SAXException - The application may raise an exception.

internalEntityDecl

public void internalEntityDecl(java.lang.String name,
                               java.lang.String value)
                        throws org.xml.sax.SAXException
This method does nothing.

Specified by:
internalEntityDecl in interface org.xml.sax.ext.DeclHandler
Overrides:
internalEntityDecl in class ToStream
Parameters:
name - The name of the entity. If it is a parameter entity, the name will begin with '%'.
value - The replacement text of the entity.
Throws:
org.xml.sax.SAXException - The application may raise an exception.
See Also:
ToStream.externalEntityDecl(java.lang.String, java.lang.String, java.lang.String), DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)

externalEntityDecl

public void externalEntityDecl(java.lang.String name,
                               java.lang.String publicId,
                               java.lang.String systemId)
                        throws org.xml.sax.SAXException
This method does nothing.

Specified by:
externalEntityDecl in interface org.xml.sax.ext.DeclHandler
Overrides:
externalEntityDecl in class ToStream
Parameters:
name - The name of the entity. If it is a parameter entity, the name will begin with '%'.
publicId - The declared public identifier of the entity, or null if none was declared.
systemId - The declared system identifier of the entity.
Throws:
org.xml.sax.SAXException - The application may raise an exception.
See Also:
ToStream.internalEntityDecl(java.lang.String, java.lang.String), DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)

addUniqueAttribute

public void addUniqueAttribute(java.lang.String name,
                               java.lang.String value,
                               int flags)
                        throws org.xml.sax.SAXException
This method is used to add an attribute to the currently open element. The caller has guaranted that this attribute is unique, which means that it not been seen before and will not be seen again.

Parameters:
name - the qualified name of the attribute
value - the value of the attribute which can contain only ASCII printable characters characters in the range 32 to 127 inclusive.
flags - the bit values of this integer give optimization information.
Throws:
org.xml.sax.SAXException

comment

public void comment(char[] ch,
                    int start,
                    int length)
             throws org.xml.sax.SAXException
Description copied from class: ToStream
Receive notification of 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).

Specified by:
comment in interface org.xml.sax.ext.LexicalHandler
Overrides:
comment in class ToStream
Parameters:
ch - An array holding the characters in the comment.
start - The starting position in the array.
length - The number of characters to use from the array.
Throws:
org.xml.sax.SAXException - The application may raise an exception.

reset

public boolean reset()
Description copied from class: ToStream
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).

Specified by:
reset in interface Serializer
Overrides:
reset in class ToStream
Returns:
true if the class was successfuly reset.

resetToHTMLStream

private void resetToHTMLStream()