|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.lotus.xsl.FormatterToXML
FormatterToXML formats SAX-style events into XML.
Field Summary | |
int |
indent
|
java.lang.String |
m_attrSpecialChars
These are characters that will be escaped in the output. |
boolean |
m_escapeCData
If true, characters in cdata sections are escaped, instead of being writted out as cdata sections. |
boolean |
m_shouldWriteXMLHeader
|
boolean |
m_stripCData
If true, cdata sections are simply stripped of their CDATA brackets, without escaping. |
Constructor Summary | |
FormatterToXML(java.io.Writer writer)
Constructor for default encoding. |
|
FormatterToXML(java.io.Writer writer,
java.lang.String encoding)
Constructor for customized encoding. |
|
FormatterToXML(java.io.Writer writer,
java.lang.String encoding,
java.lang.String doctype,
boolean doIndent,
int indent)
Constructor for customized encoding and doctype. |
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 |
comment(java.lang.String data)
Called when a Comment is to be constructed. |
void |
endDocument()
Receive notification of the end of a document. |
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. |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Receive notification of ignorable whitespace in element content. |
void |
indent(java.io.Writer pw,
int n)
Prints a newline character and n spaces. |
static java.lang.String |
prepAttrString(java.lang.String string,
java.lang.String specials,
java.lang.String encoding)
Returns the specified string after substituting specials, and UTF-16 surrogates for chracter references &#xnn . |
static void |
printSpace(java.io.Writer pw,
int n)
Prints n spaces. |
void |
processingInstruction(java.lang.String target,
java.lang.String data)
Receive notification of a processing instruction. |
void |
setDocumentLocator(com.lotus.xsl.Locator locator)
Receive an object for locating the origin of SAX document events. |
void |
startDocument()
Receive notification of the beginning of a document. |
void |
startElement(java.lang.String name,
com.lotus.xsl.AttributeList atts)
Receive notification of the beginning of an element. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public boolean m_stripCData
public boolean m_escapeCData
public boolean m_shouldWriteXMLHeader
public int indent
public java.lang.String m_attrSpecialChars
Constructor Detail |
public FormatterToXML(java.io.Writer writer, java.lang.String encoding)
writer
- The character output stream to use.encoding
- Java character encoding in use by writer.public FormatterToXML(java.io.Writer writer)
writer
- The character output stream to use.public FormatterToXML(java.io.Writer writer, java.lang.String encoding, java.lang.String doctype, boolean doIndent, int indent)
writer
- The character output stream to use.encoding
- Java character encoding in use by writer.doctype
- String to be printed at the top of the document.indent
- Number of spaces to indent at each nesting level.Method Detail |
public void setDocumentLocator(com.lotus.xsl.Locator locator)
locator
- An object that can return the location of
any SAX document event.org.xml.sax.Locator
public void startDocument() throws com.lotus.xsl.SAXException
public void endDocument() throws com.lotus.xsl.SAXException
public void startElement(java.lang.String name, com.lotus.xsl.AttributeList atts) throws com.lotus.xsl.SAXException
name
- The element type name.atts
- The attributes attached to the element, if any.endElement(java.lang.String)
,
org.xml.sax.AttributeList
public void endElement(java.lang.String name) throws com.lotus.xsl.SAXException
name
- The element type namepublic void processingInstruction(java.lang.String target, java.lang.String data) throws com.lotus.xsl.SAXException
target
- The processing instruction target.data
- The processing instruction data, or null if
none was supplied.public void comment(java.lang.String data) throws com.lotus.xsl.SAXException
data
- The comment data.public void cdata(char[] ch, int start, int length) throws com.lotus.xsl.SAXException
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).
ch
- The characters from the XML document.start
- The start position in the array.length
- The number of characters to read from the array.ignorableWhitespace(char[], int, int)
,
org.xml.sax.Locator
public void characters(char[] chars, int start, int length) throws com.lotus.xsl.SAXException
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).
chars
- The characters from the XML document.start
- The start position in the array.length
- The number of characters to read from the array.ignorableWhitespace(char[], int, int)
,
org.xml.sax.Locator
public void ignorableWhitespace(char[] ch, int start, int length) throws com.lotus.xsl.SAXException
ch
- The characters from the XML document.start
- The start position in the array.length
- The number of characters to read from the array.characters(char[], int, int)
public void entityReference(java.lang.String name) throws com.lotus.xsl.SAXException
public static java.lang.String prepAttrString(java.lang.String string, java.lang.String specials, java.lang.String encoding) throws com.lotus.xsl.SAXException
&#xnn
.string
- String to convert to XML format.specials
- Chracters, should be represeted in chracter referenfces.encoding
- CURRENTLY NOT IMPLEMENTED.#backReference
public static void printSpace(java.io.Writer pw, int n) throws com.lotus.xsl.SAXException
pw
- The character output stream to use.n
- Number of spaces to print.public void indent(java.io.Writer pw, int n) throws com.lotus.xsl.SAXException
pw
- The character output stream to use.n
- Number of spaces to print.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |