BEA Systems, Inc.

WebLogic Server 6.0sp2 API Reference

weblogic.apache.xalan.xpath.xml
Class FormatterToHTML

java.lang.Object
  |
  +--weblogic.apache.xalan.xpath.xml.FormatterToXML
        |
        +--weblogic.apache.xalan.xpath.xml.FormatterToHTML

public class FormatterToHTML
extends FormatterToXML

FormatterToHTML formats SAX-style events into XML. Warning: this class will be replaced by the Xerces Serializer classes.

This class is based on an implementation from the Apache XML Project. In future releases the XML parser, XSLT processor, and associated classes will likely be updated to be based on a later version of the Apache implementations. Since Apache does not guarantee backwards compatibility between versions of their software, we cannot guarantee backwards compatibility of any of the classes contained in the weblogic.apache package or sub-packages.

Author:
Copyright © 2001 BEA Systems, Inc. All Rights Reserved.

Fields inherited from class weblogic.apache.xalan.xpath.xml.FormatterToXML
indent, level, m_attrCharsMap, m_attrSpecialChars, m_byteBuf, m_charBuf, m_charsMap, m_currentIndent, m_doIndent, m_elemStack, m_encoding, m_escapeCData, m_inCData, m_inEntityRef, m_ispreserve, m_isprevtext, m_lineSep, m_lineSepLen, m_outputStream, m_pos, m_preserves, m_shouldNotWriteXMLHeader, m_spaceBeforeClose, m_stripCData, m_version, m_writer, s_revsize
 
Constructor Summary
FormatterToHTML()
          Default constructor.
FormatterToHTML(FormatterToXML xmlListener)
          Constructor using a writer.
FormatterToHTML(java.io.OutputStream os)
          Constructor using an output stream, and a simple OutputFormat.
FormatterToHTML(java.io.Writer writer)
          Constructor using a writer.
 
Method Summary
 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 endElement(java.lang.String name)
          Receive notification of the end of an element.
 void entityReference(java.lang.String name)
          Receive notivication of a entityReference.
 boolean getSpecialEscapeURLs()
          Tells if the formatter should use special URL escaping.
protected  void initAttrCharsMap()
          Set the attribute characters what will require special mapping.
protected  void initCharsMap()
          Set the characters what will require special mapping.
protected  void processAttribute(java.lang.String name, weblogic.apache.xalan.xpath.xml.ElemDesc elemDesc, java.lang.String value)
          Process an attribute.
 void processingInstruction(java.lang.String target, java.lang.String data)
          Receive notification of a processing instruction.
 void setSpecialEscapeURLs(boolean bool)
          Tells if the formatter should use special URL escaping.
 void startDocument()
          Receive notification of the beginning of a document.
 void startElement(java.lang.String name, org.xml.sax.AttributeList 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, java.lang.String encoding)
          Write the specified string after substituting non ASCII characters, with %HH, where HH is the hex of the byte value.
 
Methods inherited from class weblogic.apache.xalan.xpath.xml.FormatterToXML
accum, accum, accum, accum, charactersRaw, childNodesWereAdded, comment, convertJava2MimeEncoding, convertMime2JavaEncoding, endCDATA, endDocument, endDTD, endEntity, flush, flushWriter, getWriter, ignorableWhitespace, indent, init, init, initEncodings, openElementForChildren, outputLineSep, printSpace, processAttribute, setDocumentLocator, shouldIndent, startCDATA, startDTD, startEntity, writeParentTagEnd
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormatterToHTML

public FormatterToHTML()
Default constructor.

FormatterToHTML

public FormatterToHTML(java.io.Writer writer)
Constructor using a writer.

Parameters:
writer - The character output stream to use.

FormatterToHTML

public FormatterToHTML(java.io.OutputStream os)
                throws java.io.UnsupportedEncodingException
Constructor using an output stream, and a simple OutputFormat.

Parameters:
writer - The character output stream to use.

FormatterToHTML

public FormatterToHTML(FormatterToXML xmlListener)
Constructor using a writer.

Parameters:
writer - The character output stream to use.
Method Detail

setSpecialEscapeURLs

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

getSpecialEscapeURLs

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

initAttrCharsMap

protected void initAttrCharsMap()
Set the attribute characters what will require special mapping.

Overrides:
initAttrCharsMap in class FormatterToXML

initCharsMap

protected void initCharsMap()
Set the characters what will require special mapping.

Overrides:
initCharsMap in class FormatterToXML

startDocument

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

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

startElement

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

Parameters:
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.
Overrides:
startElement in class FormatterToXML
See Also:
endElement(java.lang.String), AttributeList

endElement

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

Parameters:
name - The element type name
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
Overrides:
endElement in class FormatterToXML

processAttribute

protected void processAttribute(java.lang.String name,
                                weblogic.apache.xalan.xpath.xml.ElemDesc elemDesc,
                                java.lang.String value)
                         throws org.xml.sax.SAXException
Process an attribute.

Parameters:
name - The name of the attribute.
value - The value of the attribute.

writeAttrURI

public void writeAttrURI(java.lang.String string,
                         java.lang.String encoding)
                  throws org.xml.sax.SAXException
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.
specials - Chracters, should be represeted in chracter referenfces.
encoding - CURRENTLY NOT IMPLEMENTED.
See Also:
#backReference

writeAttrString

public void writeAttrString(java.lang.String string,
                            java.lang.String encoding)
                     throws org.xml.sax.SAXException
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.
Overrides:
writeAttrString in class FormatterToXML
See Also:
#backReference

characters

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

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.
Overrides:
characters in class FormatterToXML
See Also:
FormatterToXML.ignorableWhitespace(char[], int, int), Locator

cdata

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

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.
Overrides:
cdata in class FormatterToXML
See Also:
FormatterToXML.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.
Overrides:
processingInstruction in class FormatterToXML

entityReference

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

Overrides:
entityReference in class FormatterToXML

Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs60