| java.lang.Object org.apache.xml.serializer.SerializerBase org.apache.xml.serializer.ToStream org.apache.xml.serializer.ToTextStream
ToTextStream | final public class ToTextStream extends ToStream (Code) | | This class is not a public API.
It is only public because it is used in other packages.
This class converts SAX or SAX-like calls to a
serialized document for xsl:output method of "text".
|
Constructor Summary | |
public | ToTextStream() Default constructor. |
Method Summary | |
public void | addAttribute(String uri, String localName, String rawName, String type, String value, boolean XSLAttribute) | public void | addAttribute(String name, String value) | public void | addUniqueAttribute(String qName, String value, int flags) | public void | cdata(char ch, int start, int length) Receive notification of cdata.
The Parser will call this method to report each chunk of
character data. | public void | characters(char ch, int start, int length) Receive notification of character data.
The Parser will call this method to report each chunk of
character data. | public void | characters(String characters) | public void | charactersRaw(char ch, int start, int length) If available, when the disable-output-escaping attribute is used,
output raw text without escaping. | public void | comment(String data) Called when a Comment is to be constructed. | public void | comment(char ch, int start, int length) Report an XML comment anywhere in the document. | public void | endCDATA() | public void | 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. | public void | endElement(String namespaceURI, String localName, String name) Receive notification of the end of an element. | public void | endElement(String elemName) | public void | entityReference(String name) Receive notivication of a entityReference. | public void | flushPending() | public void | ignorableWhitespace(char ch, int start, int length) Receive notification of ignorable whitespace in element content. | public void | namespaceAfterStartElement(String prefix, String uri) | public void | processingInstruction(String target, String data) Receive notification of a processing instruction. | protected void | startDocumentInternal() Receive notification of the beginning of a document. | public void | startElement(String namespaceURI, String localName, String name, Attributes atts) Receive notification of the beginning of an element.
The Parser will invoke this method at the beginning of every
element in the XML document; there will be a corresponding
endElement() event for every startElement() event (even when the
element is empty). | public void | startElement(String elementNamespaceURI, String elementLocalName, String elementName) | public boolean | startPrefixMapping(String prefix, String uri, boolean shouldFlush) | public void | startPrefixMapping(String prefix, String uri) | void | writeNormalizedChars(char ch, int start, int length, boolean useLineSep) Normalize the characters, but don't escape. |
ToTextStream | public ToTextStream()(Code) | | Default constructor.
|
cdata | public void cdata(char ch, int start, int length) throws org.xml.sax.SAXException(Code) | | 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. Parameters: start - The start position in the array. Parameters: length - The number of characters to read from the array. throws: org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception. See Also: ToTextStream.ignorableWhitespace See Also: org.xml.sax.Locator |
characters | public void characters(char ch, int start, int length) throws org.xml.sax.SAXException(Code) | | 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 - The characters from the XML document. Parameters: start - The start position in the array. Parameters: length - The number of characters to read from the array. throws: org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception. See Also: ToTextStream.ignorableWhitespace See Also: org.xml.sax.Locator |
charactersRaw | public void charactersRaw(char ch, int start, int length) throws org.xml.sax.SAXException(Code) | | If available, when the disable-output-escaping attribute is used,
output raw text without escaping.
Parameters: ch - The characters from the XML document. Parameters: start - The start position in the array. Parameters: length - The number of characters to read from the array. throws: org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception. |
comment | public void comment(String data) throws org.xml.sax.SAXException(Code) | | Called when a Comment is to be constructed.
Note that Xalan will normally invoke the other version of this method.
%REVIEW% In fact, is this one ever needed, or was it a mistake?
Parameters: data - The comment data. throws: org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception. |
comment | public void comment(char ch, int start, int length) throws org.xml.sax.SAXException(Code) | | Report 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).
Parameters: ch - An array holding the characters in the comment. Parameters: start - The starting position in the array. Parameters: length - The number of characters to use from the array. throws: org.xml.sax.SAXException - The application may raise an exception. |
endDocument | public void endDocument() throws org.xml.sax.SAXException(Code) | | 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.
throws: org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception. throws: org.xml.sax.SAXException - |
endElement | public void endElement(String namespaceURI, String localName, String name) throws org.xml.sax.SAXException(Code) | | 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: namespaceURI - The Namespace URI, or the empty string if theelement has no Namespace URI or if Namespaceprocessing is not being performed. Parameters: localName - The local name (without prefix), or theempty string if Namespace processing is not beingperformed. Parameters: name - The qualified name (with prefix), or theempty string if qualified names are not available. throws: org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception. throws: org.xml.sax.SAXException - |
ignorableWhitespace | public void ignorableWhitespace(char ch, int start, int length) throws org.xml.sax.SAXException(Code) | | Receive notification of ignorable whitespace in element content.
Validating Parsers must use this method to report each chunk
of ignorable whitespace (see the W3C XML 1.0 recommendation,
section 2.10): non-validating parsers may also use this method
if they are capable of parsing and using content models.
SAX parsers may return all contiguous whitespace 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.
Parameters: ch - The characters from the XML document. Parameters: start - The start position in the array. Parameters: length - The number of characters to read from the array. throws: org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception. See Also: ToTextStream.characters throws: org.xml.sax.SAXException - |
processingInstruction | public void processingInstruction(String target, String data) throws org.xml.sax.SAXException(Code) | | 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 - The processing instruction target. Parameters: data - The processing instruction data, or null ifnone was supplied. throws: org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception. throws: org.xml.sax.SAXException - |
startDocumentInternal | protected void startDocumentInternal() throws org.xml.sax.SAXException(Code) | | Receive notification of the beginning of a document.
The SAX parser will invoke this method only once, before any
other methods in this interface or in DTDHandler (except for
setDocumentLocator).
throws: org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception. throws: org.xml.sax.SAXException - |
startElement | public void startElement(String namespaceURI, String localName, String name, Attributes atts) throws org.xml.sax.SAXException(Code) | | Receive notification of the beginning of an element.
The Parser will invoke this method at the beginning of every
element in the XML document; there will be a corresponding
endElement() event for every startElement() event (even when the
element is empty). All of the element's content will be
reported, in order, before the corresponding endElement()
event.
If the element name has a namespace prefix, the prefix will
still be attached. Note that the attribute list provided will
contain only attributes with explicit values (specified or
defaulted): #IMPLIED attributes will be omitted.
Parameters: namespaceURI - The Namespace URI, or the empty string if theelement has no Namespace URI or if Namespaceprocessing is not being performed. Parameters: localName - The local name (without prefix), or theempty string if Namespace processing is not beingperformed. Parameters: name - The qualified name (with prefix), or theempty string if qualified names are not available. Parameters: atts - The attributes attached to the element, if any. throws: org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception. See Also: ToTextStream.endElement See Also: org.xml.sax.AttributeList throws: org.xml.sax.SAXException - |
writeNormalizedChars | void writeNormalizedChars(char ch, int start, int length, boolean useLineSep) throws IOException, org.xml.sax.SAXException(Code) | | Normalize the characters, but don't escape. Different from
SerializerToXML#writeNormalizedChars because it does not attempt to do
XML escaping at all.
Parameters: ch - The characters from the XML document. Parameters: start - The start position in the array. Parameters: length - The number of characters to read from the array. Parameters: useLineSep - true if the operating systems end-of-line separator should be output rather than a new-line character. throws: IOException - throws: org.xml.sax.SAXException - |
Methods inherited from org.apache.xml.serializer.ToStream | protected int accumDefaultEntity(java.io.Writer writer, char ch, int i, char[] chars, int len, boolean fromTextNode, boolean escLF) throws IOException(Code)(Java Doc) protected int accumDefaultEscape(Writer writer, char ch, int i, char[] chars, int len, boolean fromTextNode, boolean escLF) throws IOException(Code)(Java Doc) public boolean addAttributeAlways(String uri, String localName, String rawName, String type, String value, boolean xslAttribute)(Code)(Java Doc) public void attributeDecl(String eName, String aName, String type, String valueDefault, String value) throws SAXException(Code)(Java Doc) protected void cdata(char ch, int start, int length) throws org.xml.sax.SAXException(Code)(Java Doc) public void characters(char chars, int start, int length) throws org.xml.sax.SAXException(Code)(Java Doc) public void characters(String s) throws org.xml.sax.SAXException(Code)(Java Doc) protected void charactersRaw(char ch, int start, int length) throws org.xml.sax.SAXException(Code)(Java Doc) protected void closeCDATA() throws org.xml.sax.SAXException(Code)(Java Doc) protected void closeStartTag() throws SAXException(Code)(Java Doc) public void comment(char ch, int start, int length) throws org.xml.sax.SAXException(Code)(Java Doc) public void elementDecl(String name, String model) throws SAXException(Code)(Java Doc) public void endCDATA() throws org.xml.sax.SAXException(Code)(Java Doc) public void endDTD() throws org.xml.sax.SAXException(Code)(Java Doc) public void endElement(String namespaceURI, String localName, String name) throws org.xml.sax.SAXException(Code)(Java Doc) public void endElement(String name) throws org.xml.sax.SAXException(Code)(Java Doc) public void endNonEscaping() throws org.xml.sax.SAXException(Code)(Java Doc) public void endPrefixMapping(String prefix) throws org.xml.sax.SAXException(Code)(Java Doc) protected String ensureAttributesNamespaceIsDeclared(String ns, String localName, String rawName) throws org.xml.sax.SAXException(Code)(Java Doc) void ensurePrefixIsDeclared(String ns, String rawName) throws org.xml.sax.SAXException(Code)(Java Doc) protected boolean escapingNotNeeded(char ch)(Code)(Java Doc) public void externalEntityDecl(String name, String publicId, String systemId) throws SAXException(Code)(Java Doc) protected void firePseudoAttributes()(Code)(Java Doc) public void flushPending() throws SAXException(Code)(Java Doc) final protected void flushWriter() throws org.xml.sax.SAXException(Code)(Java Doc) public int getIndentAmount()(Code)(Java Doc) public Properties getOutputFormat()(Code)(Java Doc) public OutputStream getOutputStream()(Code)(Java Doc) public Writer getWriter()(Code)(Java Doc) public void ignorableWhitespace(char ch, int start, int length) throws org.xml.sax.SAXException(Code)(Java Doc) protected void indent(int depth) throws IOException(Code)(Java Doc) protected void indent() throws IOException(Code)(Java Doc) protected synchronized void init(OutputStream output, Properties format, boolean defaultProperties) throws UnsupportedEncodingException(Code)(Java Doc) public void internalEntityDecl(String name, String value) throws SAXException(Code)(Java Doc) public void notationDecl(String name, String pubID, String sysID) throws SAXException(Code)(Java Doc) void outputDocTypeDecl(String name, boolean closeDecl) throws SAXException(Code)(Java Doc) void outputEntityDecl(String name, String value) throws IOException(Code)(Java Doc) final protected void outputLineSep() throws IOException(Code)(Java Doc) public void processAttributes(java.io.Writer writer, int nAttrs) throws IOException, SAXException(Code)(Java Doc) public boolean reset()(Code)(Java Doc) public void serialize(Node node) throws IOException(Code)(Java Doc) public void setCdataSectionElements(Vector URI_and_localNames)(Code)(Java Doc) public void setContentHandler(ContentHandler ch)(Code)(Java Doc) public void setDTDEntityExpansion(boolean expand)(Code)(Java Doc) public void setEncoding(String encoding)(Code)(Java Doc) public boolean setEscaping(boolean escape)(Code)(Java Doc) public void setIndentAmount(int m_indentAmount)(Code)(Java Doc) public boolean setLineSepUse(boolean use_sytem_line_break)(Code)(Java Doc) public void setOutputFormat(Properties format)(Code)(Java Doc) public void setOutputStream(OutputStream output)(Code)(Java Doc) public void setTransformer(Transformer transformer)(Code)(Java Doc) public void setWriter(Writer writer)(Code)(Java Doc) protected boolean shouldIndent()(Code)(Java Doc) public void skippedEntity(String name) throws org.xml.sax.SAXException(Code)(Java Doc) public void startCDATA() throws org.xml.sax.SAXException(Code)(Java Doc) public void startDTD(String name, String publicId, String systemId) throws org.xml.sax.SAXException(Code)(Java Doc) public void startElement(String namespaceURI, String localName, String name, Attributes atts) throws org.xml.sax.SAXException(Code)(Java Doc) public void startElement(String elementNamespaceURI, String elementLocalName, String elementName) throws SAXException(Code)(Java Doc) public void startElement(String elementName) throws SAXException(Code)(Java Doc) public void startEntity(String name) throws org.xml.sax.SAXException(Code)(Java Doc) public void startNonEscaping() throws org.xml.sax.SAXException(Code)(Java Doc) public void startPrefixMapping(String prefix, String uri) throws org.xml.sax.SAXException(Code)(Java Doc) public boolean startPrefixMapping(String prefix, String uri, boolean shouldFlush) throws org.xml.sax.SAXException(Code)(Java Doc) public void unparsedEntityDecl(String name, String pubID, String sysID, String notationName) throws SAXException(Code)(Java Doc) public void writeAttrString(Writer writer, String string, String encoding) throws IOException(Code)(Java Doc) void writeNormalizedChars(char ch, int start, int length, boolean isCData, boolean useSystemLineSeparator) throws IOException, org.xml.sax.SAXException(Code)(Java Doc) protected int writeUTF16Surrogate(char c, char ch, int i, int end) throws IOException(Code)(Java Doc)
|
Methods inherited from org.apache.xml.serializer.SerializerBase | public void addAttribute(String uri, String localName, String rawName, String type, String value, boolean XSLAttribute) throws SAXException(Code)(Java Doc) public void addAttribute(String name, String value)(Code)(Java Doc) public void addAttribute(String uri, String localName, String rawName, String type, String value) throws SAXException(Code)(Java Doc) public boolean addAttributeAlways(String uri, String localName, String rawName, String type, String value, boolean XSLAttribute)(Code)(Java Doc) public void addAttributes(Attributes atts) throws SAXException(Code)(Java Doc) public void addXSLAttribute(String name, String value, String uri)(Code)(Java Doc) public ContentHandler asContentHandler() throws IOException(Code)(Java Doc) public DOMSerializer asDOMSerializer() throws IOException(Code)(Java Doc) public void characters(org.w3c.dom.Node node) throws org.xml.sax.SAXException(Code)(Java Doc) public void close()(Code)(Java Doc) public void comment(String data) throws SAXException(Code)(Java Doc) public void endEntity(String name) throws org.xml.sax.SAXException(Code)(Java Doc) public void entityReference(String name) throws org.xml.sax.SAXException(Code)(Java Doc) public void error(SAXParseException exc) throws SAXException(Code)(Java Doc) public void fatalError(SAXParseException exc) throws SAXException(Code)(Java Doc) protected void fireCDATAEvent(char[] chars, int start, int length) throws org.xml.sax.SAXException(Code)(Java Doc) protected void fireCharEvent(char[] chars, int start, int length) throws org.xml.sax.SAXException(Code)(Java Doc) protected void fireCommentEvent(char[] chars, int start, int length) throws org.xml.sax.SAXException(Code)(Java Doc) protected void fireEndDoc() throws org.xml.sax.SAXException(Code)(Java Doc) protected void fireEndElem(String name) throws org.xml.sax.SAXException(Code)(Java Doc) public void fireEndEntity(String name) throws org.xml.sax.SAXException(Code)(Java Doc) protected void fireEntityReference(String name) throws org.xml.sax.SAXException(Code)(Java Doc) protected void fireEscapingEvent(String name, String data) throws org.xml.sax.SAXException(Code)(Java Doc) protected void fireStartDoc() throws org.xml.sax.SAXException(Code)(Java Doc) protected void fireStartElem(String elemName) throws org.xml.sax.SAXException(Code)(Java Doc) protected void fireStartEntity(String name) throws org.xml.sax.SAXException(Code)(Java Doc) public String getDoctypePublic()(Code)(Java Doc) public String getDoctypeSystem()(Code)(Java Doc) public String getEncoding()(Code)(Java Doc) public boolean getIndent()(Code)(Java Doc) public int getIndentAmount()(Code)(Java Doc) protected static String getLocalName(String qname)(Code)(Java Doc) public String getMediaType()(Code)(Java Doc) public NamespaceMappings getNamespaceMappings()(Code)(Java Doc) public String getNamespaceURI(String qname, boolean isElement)(Code)(Java Doc) public String getNamespaceURIFromPrefix(String prefix)(Code)(Java Doc) public boolean getOmitXMLDeclaration()(Code)(Java Doc) public String getPrefix(String namespaceURI)(Code)(Java Doc) final protected static String getPrefixPart(String qname)(Code)(Java Doc) public String getStandalone()(Code)(Java Doc) public Transformer getTransformer()(Code)(Java Doc) public String getVersion()(Code)(Java Doc) final boolean inTemporaryOutputState()(Code)(Java Doc) protected void initCDATA()(Code)(Java Doc) protected boolean isCdataSection()(Code)(Java Doc) public void namespaceAfterStartElement(String uri, String prefix) throws SAXException(Code)(Java Doc) public void notationDecl(String arg0, String arg1, String arg2) throws SAXException(Code)(Java Doc) protected String patchName(String qname)(Code)(Java Doc) public boolean reset()(Code)(Java Doc) public void setDTDEntityExpansion(boolean expand)(Code)(Java Doc) public void setDoctype(String doctypeSystem, String doctypePublic)(Code)(Java Doc) public void setDoctypePublic(String doctypePublic)(Code)(Java Doc) public void setDoctypeSystem(String doctypeSystem)(Code)(Java Doc) public void setDocumentLocator(Locator locator)(Code)(Java Doc) public void setEncoding(String m_encoding)(Code)(Java Doc) public void setIndent(boolean doIndent)(Code)(Java Doc) public void setIndentAmount(int m_indentAmount)(Code)(Java Doc) public void setMediaType(String mediaType)(Code)(Java Doc) public void setNamespaceMappings(NamespaceMappings mappings)(Code)(Java Doc) public void setOmitXMLDeclaration(boolean b)(Code)(Java Doc) public void setSourceLocator(SourceLocator locator)(Code)(Java Doc) public void setStandalone(String standalone)(Code)(Java Doc) protected void setStandaloneInternal(String standalone)(Code)(Java Doc) public void setTransformer(Transformer t)(Code)(Java Doc) public void setVersion(String version)(Code)(Java Doc) public void startDocument() throws org.xml.sax.SAXException(Code)(Java Doc) protected void startDocumentInternal() throws org.xml.sax.SAXException(Code)(Java Doc) public void unparsedEntityDecl(String arg0, String arg1, String arg2, String arg3) throws SAXException(Code)(Java Doc) public void warning(SAXParseException exc) throws SAXException(Code)(Java Doc)
|
|
|