org.apache.xml.serializer
Class ToHTMLStream

java.lang.Object
  |
  +--org.apache.xml.serializer.SerializerBase
        |
        +--org.apache.xml.serializer.ToStream
              |
              +--org.apache.xml.serializer.ToHTMLStream

public class ToHTMLStream
extends ToStream


Constructor Summary
ToHTMLStream()
          Default constructor.
 
Method Summary
 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.
 void comment(char[] ch, int start, int length)
           
 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)
           
 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.
 void internalEntityDecl(java.lang.String name, java.lang.String value)
          This method does nothing.
 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().
 void processAttributes(int nAttrs)
          If passed in via attribSAX, process the official SAX attributes otherwise process the collected attributes from SAX-like calls for an element from calls to attribute(String name, String value)
 void processingInstruction(java.lang.String target, java.lang.String data)
          Receive notification of a processing instruction.
 boolean reset()
           
 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 setOutputStream(java.io.OutputStream output)
          Specifies an output stream to which the document should be serialized.
 void setSpecialEscapeURLs(boolean bool)
          Tells if the formatter should use special URL escaping.
 void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
           
 void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String name, Attributes atts)
          Receive notification of the beginning of an element.
 void writeAttrString(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.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
addAttributeAlways, characters, endCDATA, endNonEscaping, endPrefixMapping, flushPending, getIndentAmount, getOutputFormat, getOutputStream, getWriter, ignorableWhitespace, serialize, setCdataSectionElements, setContentHandler, setEscaping, setIndentAmount, setTransformer, setWriter, skippedEntity, startCDATA, startElement, startElement, startEntity, startNonEscaping, startPrefixMapping, startPrefixMapping, writeAttrString
 
Methods inherited from class org.apache.xml.serializer.SerializerBase
addAttribute, addAttribute, addAttributes, asContentHandler, asDOMSerializer, characters, close, comment, endEntity, error, fatalError, fireEndEntity, getDoctypePublic, getDoctypeSystem, getEncoding, getIndent, getMediaType, getNamespaceMappings, getNamespaceURI, getNamespaceURIFromPrefix, getOmitXMLDeclaration, getPrefix, getStandalone, getTransformer, getVersion, setDoctype, setDoctypePublic, setDoctypeSystem, setDocumentLocator, setEncoding, setIndent, setMediaType, setNamespaceMappings, setOmitXMLDeclaration, setSourceLocator, setStandalone, setVersion, startDocument, warning
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToHTMLStream

public ToHTMLStream()
Default constructor.
Method Detail

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.
Parameters:
format - The output format to use
Overrides:
setOutputFormat in class ToStream

endDocument

public final void endDocument()
                       throws SAXException
Receive notification of the end of a document.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
SAXException -  

startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String localName,
                         java.lang.String name,
                         Attributes atts)
                  throws SAXException
Receive notification of the beginning of an element.
Parameters:
namespaceURI -  
localName -  
name - The element type name.
atts - The attributes attached to the element, if any.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
Overrides:
startElement in class ToStream
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 SAXException
Receive notification of the end of an element.
Parameters:
namespaceURI -  
localName -  
name - The element type name
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
Overrides:
endElement in class ToStream

writeAttrURI

public void writeAttrURI(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:
SAXException - if a bad surrogate pair is detected.

writeAttrString

public void writeAttrString(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.
Parameters:
string - String to convert to XML format.
encoding - CURRENTLY NOT IMPLEMENTED.
Throws:
SAXException -  

characters

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

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:
SAXException - Any SAX exception, possibly wrapping another exception.
SAXException -  
Overrides:
characters in class ToStream
See Also:
ToStream.ignorableWhitespace(char[], int, int), Locator

cdata

public final void cdata(char[] ch,
                        int start,
                        int length)
                 throws 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).

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:
SAXException - Any SAX exception, possibly wrapping another exception.
SAXException -  
See Also:
ToStream.ignorableWhitespace(char[], int, int), Locator

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws 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:
SAXException - Any SAX exception, possibly wrapping another exception.
SAXException -  

entityReference

public final void entityReference(java.lang.String name)
                           throws SAXException
Receive notivication of a entityReference.
Parameters:
name - non-null reference to entity name string.
Throws:
SAXException -  
Overrides:
entityReference in class SerializerBase

endElement

public final void endElement(java.lang.String elemName)
                      throws SAXException
Overrides:
endElement in class ToStream
See Also:
ExtendedContentHandler.endElement(String)

processAttributes

public void processAttributes(int nAttrs)
                       throws java.io.IOException,
                              SAXException
If passed in via attribSAX, process the official SAX attributes otherwise process the collected attributes from SAX-like calls for an element from calls to attribute(String name, String value)
Parameters:
nAttrs - the number of attributes in m_attributes to be processed
Throws:
SAXException -  
Overrides:
processAttributes in class ToStream

setOutputStream

public void setOutputStream(java.io.OutputStream output)
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.

Parameters:
output - The output stream
Overrides:
setOutputStream in class ToStream

namespaceAfterStartElement

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

startDTD

public void startDTD(java.lang.String name,
                     java.lang.String publicId,
                     java.lang.String systemId)
              throws SAXException
Overrides:
startDTD in class ToStream

endDTD

public void endDTD()
            throws SAXException
Report the end of DTD declarations.
Throws:
SAXException - The application may raise an exception.
Overrides:
endDTD in class ToStream
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 SAXException
This method does nothing.
Overrides:
attributeDecl in class ToStream

elementDecl

public void elementDecl(java.lang.String name,
                        java.lang.String model)
                 throws SAXException
This method does nothing.
Overrides:
elementDecl in class ToStream

internalEntityDecl

public void internalEntityDecl(java.lang.String name,
                               java.lang.String value)
                        throws SAXException
This method does nothing.
Overrides:
internalEntityDecl in class ToStream

externalEntityDecl

public void externalEntityDecl(java.lang.String name,
                               java.lang.String publicId,
                               java.lang.String systemId)
                        throws SAXException
This method does nothing.
Overrides:
externalEntityDecl in class ToStream

comment

public void comment(char[] ch,
                    int start,
                    int length)
             throws SAXException
Overrides:
comment in class ToStream

reset

public boolean reset()
Overrides:
reset in class ToStream


Copyright © 2003 Apache XML Project. All Rights Reserved.