| java.lang.Object org.apache.xml.serializer.SerializerBase org.apache.xml.serializer.ToSAXHandler org.apache.xml.serializer.ToHTMLSAXHandler
ToHTMLSAXHandler | final public class ToHTMLSAXHandler extends ToSAXHandler (Code) | | This class accepts SAX-like calls, then sends true SAX calls to a
wrapped SAX handler. There is optimization done knowing that the ultimate
output is HTML.
This class is not a public API.
|
Method Summary | |
public void | attributeDecl(String eName, String aName, String type, String valueDefault, String value) Does nothing. | public void | characters(String chars) Receive notification of character data. | public void | characters(char[] ch, int off, int len) Receive notification of character data.
The Parser will call this method to report each chunk of
character data. | public void | close() Do nothing. | protected void | closeStartTag() This method is called when all the data needed for a call to the
SAX handler's startElement() method has been gathered. | public void | comment(char[] ch, int start, int length) Receive notification of a comment anywhere in the document. | public void | elementDecl(String name, String model) Does nothing. | public void | endCDATA() Does nothing. | public void | endDTD() Does nothing. | 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 uri, String localName, String qName) Receive notification of the end of an element. | public void | endElement(String elementName) Receive notification of the end of an element. | public void | endPrefixMapping(String prefix) Does nothing. | public void | externalEntityDecl(String arg0, String arg1, String arg2) | public void | flushPending() This method flushes any pending events, which can be startDocument()
closing the opening tag of an element, or closing an open CDATA section. | public Properties | getOutputFormat() Returns null. | public OutputStream | getOutputStream() | public Writer | getWriter() | public void | ignorableWhitespace(char[] ch, int start, int length) Does nothing. | public void | indent(int n) Does nothing. | public void | internalEntityDecl(String name, String value) Does nothing. | public void | namespaceAfterStartElement(String prefix, 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(). | public void | processingInstruction(String target, String data) Receive notification of a processing instruction. | public boolean | reset() Try's to reset the super class and reset this class for
re-use, so that you don't need to create a new serializer
(mostly for performance reasons). | public void | serialize(Node node) Does nothing. | public void | setDocumentLocator(Locator arg0) Does nothing. | public boolean | setEscaping(boolean escape) Turns special character escaping on/off. | public void | setIndent(boolean indent) | public void | setOutputFormat(Properties format) Does nothing. | public void | setOutputStream(OutputStream output) Does nothing. | public void | setWriter(Writer writer) Does nothing. | public void | skippedEntity(String arg0) Does nothing. | public void | startCDATA() Does nothing. | public void | startElement(String namespaceURI, String localName, String qName, Attributes atts) Receive notification of the beginning of an element, although this is a
SAX method additional namespace or attribute information can occur before
or after this call, that is associated with this element. | public void | startElement(String elementNamespaceURI, String elementLocalName, String elementName) An element starts, but attributes are not fully known yet. | public void | startElement(String elementName) An element starts, but attributes are not fully known yet. | public void | startEntity(String arg0) Does nothing. | public boolean | startPrefixMapping(String prefix, String uri, boolean shouldFlush) Handle a prefix/uri mapping, which is associated with a startElement()
that is soon to follow. | public void | startPrefixMapping(String prefix, String uri) Begin the scope of a prefix-URI Namespace mapping
just before another element is about to start. |
m_escapeSetting | protected boolean m_escapeSetting(Code) | | Keeps track of whether output escaping is currently enabled
|
ToHTMLSAXHandler | public ToHTMLSAXHandler(ContentHandler handler, String encoding)(Code) | | A constructor
Parameters: handler - the wrapped SAX content handler Parameters: encoding - the encoding of the output HTML document |
ToHTMLSAXHandler | public ToHTMLSAXHandler(ContentHandler handler, LexicalHandler lex, String encoding)(Code) | | A constructor.
Parameters: handler - the wrapped SAX content handler Parameters: lex - the wrapped lexical handler Parameters: encoding - the encoding of the output HTML document |
characters | public void characters(char[] ch, int off, int len) throws 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: off - The start position in the array. Parameters: len - The number of characters to read from the array. throws: org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception. See Also: ToHTMLSAXHandler.ignorableWhitespace See Also: org.xml.sax.Locator throws: org.xml.sax.SAXException - See Also: org.xml.sax.ContentHandler.characters(char[]intint) |
closeStartTag | protected void closeStartTag() throws SAXException(Code) | | This method is called when all the data needed for a call to the
SAX handler's startElement() method has been gathered.
|
comment | public void comment(char[] ch, int start, int length) throws SAXException(Code) | | Receive notification of a comment anywhere in the document. This callback
will be used for comments inside or outside the document element.
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. See Also: org.xml.sax.ext.LexicalHandler.comment(char[]intint) |
endDocument | public void endDocument() throws 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 uri, String localName, String qName) throws 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: uri - 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: qName - 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. See Also: org.xml.sax.ContentHandler.endElement(StringStringString) |
flushPending | public void flushPending() throws SAXException(Code) | | This method flushes any pending events, which can be startDocument()
closing the opening tag of an element, or closing an open CDATA section.
|
namespaceAfterStartElement | public void namespaceAfterStartElement(String prefix, String uri) throws SAXException(Code) | | 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: prefix - the prefix associated with the given URI. Parameters: uri - the URI of the namespace See Also: ExtendedContentHandler.namespaceAfterStartElement(StringString) |
processingInstruction | public void processingInstruction(String target, String data) throws 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 - See Also: org.xml.sax.ContentHandler.processingInstruction(StringString) |
reset | public boolean reset()(Code) | | Try's to reset the super class and reset this class for
re-use, so that you don't need to create a new serializer
(mostly for performance reasons).
true if the class was successfuly reset. See Also: Serializer.reset |
startElement | public void startElement(String elementNamespaceURI, String elementLocalName, String elementName) throws SAXException(Code) | | An element starts, but attributes are not fully known yet.
Parameters: elementNamespaceURI - the URI of the namespace of the element(optional) Parameters: elementLocalName - the element name, but without prefix(optional) Parameters: elementName - the element name, with prefix, if any (required) See Also: ExtendedContentHandler.startElement(String) |
startPrefixMapping | public boolean startPrefixMapping(String prefix, String uri, boolean shouldFlush) throws SAXException(Code) | | Handle a prefix/uri mapping, which is associated with a startElement()
that is soon to follow. Need to close any open start tag to make
sure than any name space attributes due to this event are associated wih
the up comming element, not the current one.
See Also: ExtendedContentHandler.startPrefixMapping Parameters: prefix - The Namespace prefix being declared. Parameters: uri - The Namespace URI the prefix is mapped to. Parameters: shouldFlush - true if any open tags need to be closed first, thiswill impact which element the mapping applies to (open parent, or its upcomming child) returns true if the call made a change to the currentnamespace information, false if it did not change anything, e.g. if theprefix/namespace mapping was already in scope from before. throws: org.xml.sax.SAXException - The client may throwan exception during processing. |
startPrefixMapping | public void startPrefixMapping(String prefix, String uri) throws org.xml.sax.SAXException(Code) | | Begin the scope of a prefix-URI Namespace mapping
just before another element is about to start.
This call will close any open tags so that the prefix mapping
will not apply to the current element, but the up comming child.
See Also: org.xml.sax.ContentHandler.startPrefixMapping Parameters: prefix - The Namespace prefix being declared. Parameters: uri - The Namespace URI the prefix is mapped to. throws: org.xml.sax.SAXException - The client may throwan exception during processing. |
Methods inherited from org.apache.xml.serializer.ToSAXHandler | public void addUniqueAttribute(String qName, String value, int flags) throws SAXException(Code)(Java Doc) public void characters(String characters) throws SAXException(Code)(Java Doc) public void characters(org.w3c.dom.Node node) throws org.xml.sax.SAXException(Code)(Java Doc) protected void closeCDATA() throws SAXException(Code)(Java Doc) protected void closeStartTag() throws SAXException(Code)(Java Doc) public void comment(String comment) throws SAXException(Code)(Java Doc) public void error(SAXParseException exc) throws SAXException(Code)(Java Doc) public void fatalError(SAXParseException exc) throws SAXException(Code)(Java Doc) public void flushPending() throws SAXException(Code)(Java Doc) boolean getShouldOutputNSAttr()(Code)(Java Doc) public void processingInstruction(String target, String data) throws SAXException(Code)(Java Doc) public boolean reset()(Code)(Java Doc) public void setCdataSectionElements(Vector URI_and_localNames)(Code)(Java Doc) public void setContentHandler(ContentHandler _saxHandler)(Code)(Java Doc) public void setLexHandler(LexicalHandler _lexHandler)(Code)(Java Doc) public void setShouldOutputNSAttr(boolean doOutputNSAttr)(Code)(Java Doc) public void setTransformState(TransformStateSetter ts)(Code)(Java Doc) public void startDTD(String arg0, String arg1, String arg2) throws SAXException(Code)(Java Doc) protected void startDocumentInternal() throws SAXException(Code)(Java Doc) public void startElement(String arg0, String arg1, String arg2, Attributes arg3) throws SAXException(Code)(Java Doc) public void startElement(String uri, String localName, String qName) throws SAXException(Code)(Java Doc) public void startElement(String qName) throws SAXException(Code)(Java Doc) public void warning(SAXParseException exc) throws SAXException(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)
|
|
|