Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.apache.xml.serializer.SerializerBase
org.apache.xml.serializer.ToSAXHandler
org.apache.xml.serializer.ToTextSAXHandler
public class ToTextSAXHandler
extends ToSAXHandler
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 | |
BEGCDATA , CDATA_CONTINUE , CDATA_DELIMITER_CLOSE , CDATA_DELIMITER_OPEN , CNTCDATA , DEFAULT_SAX_SERIALIZER , EMPTYSTRING , ENDCDATA , ENTITY_AMP , ENTITY_CRLF , ENTITY_GT , ENTITY_LT , ENTITY_QUOT , XMLNS_PREFIX , XMLNS_URI , XML_PREFIX |
Constructor Summary | |
| |
|
Method Summary | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
Properties | |
OutputStream | |
Writer | |
void |
|
void |
|
void |
|
void |
|
void |
|
boolean |
|
void | |
void |
|
boolean |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
void |
|
boolean |
|
Methods inherited from class org.apache.xml.serializer.ToSAXHandler | |
addUniqueAttribute , characters , characters , comment , error , fatalError , flushPending , processingInstruction , reset , setCdataSectionElements , setContentHandler , setLexHandler , setShouldOutputNSAttr , setTransformState , startDTD , startElement , startElement , startElement , warning |
public void addAttribute(String name, String value)
From XSLTC
- Specified by:
- addAttribute in interface ExtendedContentHandler
- Overrides:
- addAttribute in interface SerializerBase
public void addAttribute(String uri, String localName, String rawName, String type, String value)
- Specified by:
- addAttribute in interface ExtendedContentHandler
- Overrides:
- addAttribute in interface SerializerBase
public void attributeDecl(String arg0, String arg1, String arg2, String arg3, String arg4) throws SAXException
- Specified by:
- attributeDecl in interface DeclHandler
public void characters(String characters) throws SAXException
- Specified by:
- characters in interface ExtendedContentHandler
- Overrides:
- characters in interface ToSAXHandler
public void characters(char[] characters, int offset, int length) throws SAXException
- See Also:
org.xml.sax.ContentHandler.characters(char[], int, int)
public void comment(String data) throws SAXException
Receive notification of a comment.
- Specified by:
- comment in interface ExtendedLexicalHandler
- Overrides:
- comment in interface ToSAXHandler
public void comment(ch[] , int start, int length) throws SAXException
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). Comments in the DTD must be properly nested inside start/endDTD and start/endEntity events (if used).
- Specified by:
- comment in interface LexicalHandler
- Parameters:
start
- The starting position in the array.length
- The number of characters to use from the array.
- Throws:
SAXException
- The application may raise an exception.
public void elementDecl(String arg0, String arg1) throws SAXException
- Specified by:
- elementDecl in interface DeclHandler
public void endCDATA() throws SAXException
- Specified by:
- endCDATA in interface LexicalHandler
- See Also:
LexicalHandler.endCDATA()
public void endDTD() throws SAXException
- Specified by:
- endDTD in interface LexicalHandler
- See Also:
LexicalHandler.endDTD()
public void endDocument() throws SAXException
From XSLTC
- Specified by:
- endDocument in interface ContentHandler
- See Also:
ContentHandler.endDocument()
public void endElement(String elemName) throws SAXException
From XSLTC
- Specified by:
- endElement in interface ExtendedContentHandler
public void endElement(String arg0, String arg1, String arg2) throws SAXException
- Specified by:
- endElement in interface ContentHandler
public void endPrefixMapping(String arg0) throws SAXException
- Specified by:
- endPrefixMapping in interface ContentHandler
public void externalEntityDecl(String arg0, String arg1, String arg2) throws SAXException
- Specified by:
- externalEntityDecl in interface DeclHandler
public Properties getOutputFormat()
- Specified by:
- getOutputFormat in interface Serializer
- See Also:
Serializer.getOutputFormat()
public OutputStream getOutputStream()
- Specified by:
- getOutputStream in interface Serializer
- See Also:
Serializer.getOutputStream()
public Writer getWriter()
- Specified by:
- getWriter in interface Serializer
- See Also:
Serializer.getWriter()
public void ignorableWhitespace(char[] arg0, int arg1, int arg2) throws SAXException
- See Also:
org.xml.sax.ContentHandler.ignorableWhitespace(char[], int, int)
public void indent(int n) throws SAXException
Does nothing because the indent attribute is ignored for text output.
public void internalEntityDecl(String arg0, String arg1) throws SAXException
- Specified by:
- internalEntityDecl in interface DeclHandler
public void namespaceAfterStartElement(String prefix, String uri) throws SAXException
This method is used to notify that a prefix mapping is to start, but after an element is started. The SAX method callstartPrefixMapping(prefix,uri)is used just before an element starts and applies to the element to come, not to the current element. This method applies to the current element. For example one could make the calls in this order:startElement("prfx8:elem9") namespaceAfterStartElement("http://namespace8","prfx8")
- Specified by:
- namespaceAfterStartElement in interface ExtendedContentHandler
- Overrides:
- namespaceAfterStartElement in interface SerializerBase
- Parameters:
prefix
- the prefix that maps to the given namespaceuri
- the namespace URI being declared
- Throws:
SAXException
-
public void processingInstruction(String arg0, String arg1) throws SAXException
From XSLTC
- Specified by:
- processingInstruction in interface ContentHandler
- Overrides:
- processingInstruction in interface ToSAXHandler
public boolean reset()
- Specified by:
- reset in interface Serializer
- Overrides:
- reset in interface ToSAXHandler
- See Also:
Serializer.reset()
public void serialize(Node node) throws IOException
- Specified by:
- serialize in interface SerializationHandler
- serialize in interface DOMSerializer
- See Also:
DOMSerializer.serialize(Node)
public void setDocumentLocator(Locator arg0)
- Specified by:
- setDocumentLocator in interface ContentHandler
- Overrides:
- setDocumentLocator in interface SerializerBase
public boolean setEscaping(boolean escape)
- Specified by:
- setEscaping in interface SerializationHandler
public void setIndent(boolean indent)
- Specified by:
- setIndent in interface XSLOutputAttributes
- Overrides:
- setIndent in interface SerializerBase
- See Also:
org.apache.xml.serializer.SerializationHandler.setIndent(boolean)
public void setOutputFormat(Properties format)
- Specified by:
- setOutputFormat in interface Serializer
public void setOutputStream(OutputStream output)
- Specified by:
- setOutputStream in interface Serializer
public void setWriter(Writer writer)
- Specified by:
- setWriter in interface Serializer
- See Also:
Serializer.setWriter(Writer)
public void skippedEntity(String arg0) throws SAXException
- Specified by:
- skippedEntity in interface ContentHandler
- See Also:
ContentHandler.skippedEntity(String)
public void startCDATA() throws SAXException
- Specified by:
- startCDATA in interface LexicalHandler
- See Also:
LexicalHandler.startCDATA()
public void startElement(String elementName) throws SAXException
An element starts, but attributes are not fully known yet.
- Specified by:
- startElement in interface ExtendedContentHandler
- Overrides:
- startElement in interface ToSAXHandler
- Parameters:
elementName
- the element name, with prefix (if any).
public void startElement(String elementNamespaceURI, String elementLocalName, String elementName) throws SAXException
From XSLTC
- Specified by:
- startElement in interface ExtendedContentHandler
- Overrides:
- startElement in interface ToSAXHandler
public void startElement(String arg0, String arg1, String arg2, Attributes arg3) throws SAXException
- Specified by:
- startElement in interface ContentHandler
- Overrides:
- startElement in interface ToSAXHandler
public void startEntity(String arg0) throws SAXException
- Specified by:
- startEntity in interface LexicalHandler
- See Also:
LexicalHandler.startEntity(String)
public void startPrefixMapping(String prefix, String uri) throws SAXException
Begin the scope of a prefix-URI Namespace mapping. The information from this event is not necessary for normal Namespace processing: the SAX XML reader will automatically replace prefixes for element and attribute names when thehttp://xml.org/sax/features/namespaces
feature is true (the default). There are cases, however, when applications need to use prefixes in character data or in attribute values, where they cannot safely be expanded automatically; the start/endPrefixMapping event supplies the information to the application to expand prefixes in those contexts itself, if necessary. Note that start/endPrefixMapping events are not guaranteed to be properly nested relative to each other: all startPrefixMapping events will occur immediately before the correspondingstartElement
event, and allendPrefixMapping
events will occur immediately after the correspondingendElement
event, but their order is not otherwise guaranteed. There should never be start/endPrefixMapping events for the "xml" prefix, since it is predeclared and immutable.
- Specified by:
- startPrefixMapping in interface ContentHandler
- Parameters:
prefix
- The Namespace prefix being declared. An empty string is used for the default element namespace, which has no prefix.uri
- The Namespace URI the prefix is mapped to.
- Throws:
SAXException
- The client may throw an exception during processing.
public boolean startPrefixMapping(String prefix, String uri, boolean shouldFlush) throws SAXException
This method is used to notify that a prefix maping is to start, which can be for the current element, or for the one to come.
- Specified by:
- startPrefixMapping in interface ExtendedContentHandler
- Parameters:
prefix
- the prefix that maps to the given URIuri
- the namespace URI of the given prefixshouldFlush
- if true this call is like the SAX startPrefixMapping(prefix,uri) call and the mapping applies to the element to come. If false the mapping applies to the current element.
- Returns:
- boolean false if the prefix mapping was already in effect (in other words we are just re-declaring), true if this is a new, never before seen mapping for the element.
- Throws:
SAXException
-