| java.lang.Object org.apache.xml.serializer.SerializerBase org.apache.xml.serializer.ToUnknownStream
ToUnknownStream | final public class ToUnknownStream extends SerializerBase (Code) | | This class wraps another SerializationHandler. The wrapped object will either
handler XML or HTML, which is not known until a little later when the first XML
tag is seen. If the first tag is then the wrapped object is an HTML
handler, otherwise it is an XML handler.
This class effectively caches the first few calls to it then passes them
on to the wrapped handler (once it exists). After that subsequent calls a
simply passed directly to the wrapped handler.
The user of this class doesn't know if the output is ultimatley XML or HTML.
This class is not a public API, it is public because it is used within Xalan.
|
Method Summary | |
public void | addAttribute(String uri, String localName, String rawName, String type, String value, boolean XSLAttribute) | public void | addAttribute(String rawName, String value) | public void | addAttributes(Attributes atts) | public void | addUniqueAttribute(String rawName, String value, int flags) | public ContentHandler | asContentHandler() | public DOMSerializer | asDOMSerializer() | public void | attributeDecl(String arg0, String arg1, String arg2, String arg3, String arg4) | public void | characters(String chars) | public void | characters(char[] characters, int offset, int length) | public void | close() | public void | comment(String comment) | public void | comment(char[] ch, int start, int length) | public void | elementDecl(String arg0, String arg1) | public void | endCDATA() | public void | endDTD() | public void | endDocument() | public void | endElement(String elementName) | public void | endElement(String namespaceURI, String localName, String qName) | public void | endEntity(String name) | public void | endPrefixMapping(String prefix) | public void | entityReference(String entityName) | public void | externalEntityDecl(String name, String publicId, String systemId) | protected void | firePseudoElement(String elementName) | public void | flushPending() | public String | getDoctypePublic() | public String | getDoctypeSystem() | public String | getEncoding() | public boolean | getIndent() | public int | getIndentAmount() | public String | getMediaType() | public NamespaceMappings | getNamespaceMappings() Get the current namespace mappings. | public String | getNamespaceURI(String qname, boolean isElement) | public String | getNamespaceURIFromPrefix(String prefix) | public boolean | getOmitXMLDeclaration() | public Properties | getOutputFormat() | public OutputStream | getOutputStream() | public String | getPrefix(String namespaceURI) | public String | getStandalone() | public Transformer | getTransformer() | public String | getVersion() | public Writer | getWriter() | public void | ignorableWhitespace(char[] ch, int start, int length) | public void | internalEntityDecl(String arg0, String arg1) | 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) | public boolean | reset() | public void | serialize(Node node) | public void | setCdataSectionElements(Vector URI_and_localNames) | public void | setContentHandler(ContentHandler ch) | public void | setDoctype(String system, String pub) | public void | setDoctypePublic(String doctype) Set the doctype in the underlying XML handler. | public void | setDoctypeSystem(String doctype) Set the doctype in the underlying XML handler. | public void | setDocumentLocator(Locator locator) | public void | setEncoding(String encoding) | public boolean | setEscaping(boolean escape) | public void | setIndent(boolean indent) | public void | setIndentAmount(int value) | public void | setMediaType(String mediaType) | public void | setOmitXMLDeclaration(boolean b) | public void | setOutputFormat(Properties format) | public void | setOutputStream(OutputStream output) | public void | setSourceLocator(SourceLocator locator) This method is used to set the source locator, which might be used to
generated an error message. | public void | setStandalone(String standalone) | public void | setTransformer(Transformer t) | public void | setVersion(String version) This method cannot be cached because default is different in
HTML and XML (we need more than a boolean). | public void | setWriter(Writer writer) | public void | skippedEntity(String name) | public void | startCDATA() | public void | startDTD(String name, String publicId, String systemId) | public void | startDocument() | public void | startElement(String qName) | public void | startElement(String namespaceURI, String localName, String qName) | public void | startElement(String namespaceURI, String localName, String elementName, Attributes atts) | public void | startEntity(String name) | public void | startPrefixMapping(String prefix, String uri) | public boolean | startPrefixMapping(String prefix, String uri, boolean shouldFlush) |
ToUnknownStream | public ToUnknownStream()(Code) | | Default constructor.
Initially this object wraps an XML Stream object, so _handler is never null.
That may change later to an HTML Stream object.
|
addAttribute | public void addAttribute(String uri, String localName, String rawName, String type, String value, boolean XSLAttribute) throws SAXException(Code) | | Adds an attribute to the currenly open tag
Parameters: uri - the URI of a namespace Parameters: localName - the attribute name, without prefix Parameters: rawName - the attribute name, with prefix (if any) Parameters: type - the type of the attribute, typically "CDATA" Parameters: value - the value of the parameter Parameters: XSLAttribute - true if this attribute is coming from an xsl:attribute element See Also: ExtendedContentHandler.addAttribute(StringStringStringStringString) |
addUniqueAttribute | public void addUniqueAttribute(String rawName, String value, int flags) throws SAXException(Code) | | Adds a unique attribute to the currenly open tag
|
firePseudoElement | protected void firePseudoElement(String elementName)(Code) | | |
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: uri - the URI of the namespace Parameters: prefix - the prefix associated with the given URI. See Also: ExtendedContentHandler.namespaceAfterStartElement(StringString) |
reset | public boolean reset()(Code) | | passes the call on to the underlying HTML or XML handler
See Also: Serializer.reset ??? |
setDoctypePublic | public void setDoctypePublic(String doctype)(Code) | | Set the doctype in the underlying XML handler. Remember that this method
was called, just in case we need to transfer this doctype to an HTML handler
Parameters: doctype - the public doctype to set See Also: XSLOutputAttributes.setDoctypePublic(String) |
setDoctypeSystem | public void setDoctypeSystem(String doctype)(Code) | | Set the doctype in the underlying XML handler. Remember that this method
was called, just in case we need to transfer this doctype to an HTML handler
Parameters: doctype - the system doctype to set See Also: XSLOutputAttributes.setDoctypeSystem(String) |
setIndentAmount | public void setIndentAmount(int value)(Code) | | Pass the call on to the underlying handler
|
setVersion | public void setVersion(String version)(Code) | | This method cannot be cached because default is different in
HTML and XML (we need more than a boolean).
|
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)
|
|
|