ToXMLSAXHandler.public final class ToTextSAXHandler extends ToSAXHandler
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CDATA_CONTINUE
To insert ]]> in a CDATA section by ending the last CDATA section with
]] and starting the next CDATA section with >
|
static java.lang.String |
CDATA_DELIMITER_CLOSE
The constant "]]>"
|
static java.lang.String |
CDATA_DELIMITER_OPEN |
static java.lang.String |
DEFAULT_SAX_SERIALIZER |
static java.lang.String |
EMPTYSTRING |
static java.lang.String |
ENTITY_AMP |
static java.lang.String |
ENTITY_CRLF |
static java.lang.String |
ENTITY_GT |
static java.lang.String |
ENTITY_LT |
static java.lang.String |
ENTITY_QUOT |
static java.lang.String |
XML_PREFIX |
static java.lang.String |
XMLNS_PREFIX |
static java.lang.String |
XMLNS_URI |
static java.lang.String |
XMLVERSION10 |
static java.lang.String |
XMLVERSION11
Define the XML version.
|
PKG_NAME, PKG_PATHHTML_ATTREMPTY, HTML_ATTRURL, NO_BAD_CHARS| Constructor and Description |
|---|
ToTextSAXHandler(org.xml.sax.ContentHandler hdlr,
org.xml.sax.ext.LexicalHandler lex,
java.lang.String encoding)
Deprecated.
|
ToTextSAXHandler(org.xml.sax.ContentHandler handler,
java.lang.String encoding)
Deprecated.
From XSLTC
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(java.lang.String name,
java.lang.String value)
Deprecated.
From XSLTC
|
void |
addAttribute(java.lang.String uri,
java.lang.String localName,
java.lang.String rawName,
java.lang.String type,
java.lang.String value,
boolean XSLAttribute)
Deprecated.
Adds the given attribute to the set of collected attributes , but only if
there is a currently open element.
|
void |
attributeDecl(java.lang.String arg0,
java.lang.String arg1,
java.lang.String arg2,
java.lang.String arg3,
java.lang.String arg4)
Deprecated.
|
void |
characters(char[] characters,
int offset,
int length)
Deprecated.
|
void |
characters(java.lang.String characters)
Deprecated.
Receive notification of character data.
|
void |
comment(char[] ch,
int start,
int length)
Deprecated.
|
void |
comment(java.lang.String data)
Deprecated.
Receive notification of a comment.
|
void |
elementDecl(java.lang.String arg0,
java.lang.String arg1)
Deprecated.
|
void |
endCDATA()
Deprecated.
|
void |
endDocument()
Deprecated.
From XSLTC
|
void |
endDTD()
Deprecated.
|
void |
endElement(java.lang.String elemName)
Deprecated.
From XSLTC
|
void |
endElement(java.lang.String arg0,
java.lang.String arg1,
java.lang.String arg2)
Deprecated.
|
void |
endPrefixMapping(java.lang.String arg0)
Deprecated.
|
void |
externalEntityDecl(java.lang.String arg0,
java.lang.String arg1,
java.lang.String arg2)
Deprecated.
|
java.util.Properties |
getOutputFormat()
Deprecated.
Returns the output format properties for this serializer.
|
java.io.OutputStream |
getOutputStream()
Deprecated.
Get the output stream where the events will be serialized to.
|
java.io.Writer |
getWriter()
Deprecated.
Get the character stream where the events will be serialized to.
|
void |
ignorableWhitespace(char[] arg0,
int arg1,
int arg2)
Deprecated.
|
void |
indent(int n)
Deprecated.
Does nothing because
the indent attribute is ignored for text output.
|
void |
internalEntityDecl(java.lang.String arg0,
java.lang.String arg1)
Deprecated.
|
void |
namespaceAfterStartElement(java.lang.String prefix,
java.lang.String uri)
Deprecated.
This method is used when a prefix/uri namespace mapping
is indicated after the element was started with a
startElement() and before and endElement().
|
void |
processingInstruction(java.lang.String arg0,
java.lang.String arg1)
Deprecated.
From XSLTC
|
boolean |
reset()
Deprecated.
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).
|
void |
serialize(org.w3c.dom.Node node)
Deprecated.
Notify that the serializer should take this DOM node as input to be
serialized.
|
void |
setDocumentLocator(org.xml.sax.Locator arg0)
Deprecated.
Receive an object for locating the origin of SAX document events.
|
boolean |
setEscaping(boolean escape)
Deprecated.
Turns special character escaping on/off.
|
void |
setIndent(boolean indent)
Deprecated.
Sets the value coming from the xsl:output indent stylesheet
attribute.
|
void |
setOutputFormat(java.util.Properties format)
Deprecated.
Specifies an output format for this serializer.
|
void |
setOutputStream(java.io.OutputStream output)
Deprecated.
Specifies an output stream to which the document should be
serialized.
|
void |
setWriter(java.io.Writer writer)
Deprecated.
Specifies a writer to which the document should be serialized.
|
void |
skippedEntity(java.lang.String arg0)
Deprecated.
|
void |
startCDATA()
Deprecated.
|
void |
startElement(java.lang.String elementName)
Deprecated.
An element starts, but attributes are not fully known yet.
|
void |
startElement(java.lang.String elementNamespaceURI,
java.lang.String elementLocalName,
java.lang.String elementName)
Deprecated.
From XSLTC
|
void |
startElement(java.lang.String arg0,
java.lang.String arg1,
java.lang.String arg2,
org.xml.sax.Attributes arg3)
Deprecated.
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.
|
void |
startEntity(java.lang.String arg0)
Deprecated.
|
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
Deprecated.
|
boolean |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri,
boolean shouldFlush)
Deprecated.
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.
|
addUniqueAttribute, characters, error, fatalError, flushPending, setCdataSectionElements, setContentHandler, setLexHandler, setShouldOutputNSAttr, setTransformState, startDTD, warningaddAttribute, addAttributeAlways, addAttributes, addXSLAttribute, asContentHandler, asDOM3Serializer, asDOMSerializer, close, documentIsEmpty, endEntity, entityReference, fireEndEntity, getDoctypePublic, getDoctypeSystem, getEncoding, getIndent, getIndentAmount, getMediaType, getNamespaceMappings, getNamespaceURI, getNamespaceURIFromPrefix, getOmitXMLDeclaration, getOutputProperty, getOutputPropertyDefault, getOutputPropertyNonDefault, getPrefix, getStandalone, getTransformer, getVersion, notationDecl, setDoctype, setDoctypePublic, setDoctypeSystem, setDTDEntityExpansion, setEncoding, setIndentAmount, setMediaType, setNamespaceMappings, setOmitXMLDeclaration, setOutputProperty, setOutputPropertyDefault, setSourceLocator, setStandalone, setTransformer, setVersion, startDocument, unparsedEntityDeclpublic static final java.lang.String CDATA_CONTINUE
public static final java.lang.String CDATA_DELIMITER_CLOSE
public static final java.lang.String CDATA_DELIMITER_OPEN
public static final java.lang.String EMPTYSTRING
public static final java.lang.String ENTITY_AMP
public static final java.lang.String ENTITY_CRLF
public static final java.lang.String ENTITY_GT
public static final java.lang.String ENTITY_LT
public static final java.lang.String ENTITY_QUOT
public static final java.lang.String XML_PREFIX
public static final java.lang.String XMLNS_PREFIX
public static final java.lang.String XMLNS_URI
public static final java.lang.String DEFAULT_SAX_SERIALIZER
public static final java.lang.String XMLVERSION11
public static final java.lang.String XMLVERSION10
public ToTextSAXHandler(org.xml.sax.ContentHandler hdlr,
org.xml.sax.ext.LexicalHandler lex,
java.lang.String encoding)
public ToTextSAXHandler(org.xml.sax.ContentHandler handler,
java.lang.String encoding)
public void endElement(java.lang.String elemName)
throws org.xml.sax.SAXException
elemName - the fully qualified element name.org.xml.sax.SAXExceptionExtendedContentHandler.endElement(String)public void endElement(java.lang.String arg0,
java.lang.String arg1,
java.lang.String arg2)
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionContentHandler.endElement(String, String, String)public void comment(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionpublic void comment(java.lang.String data)
throws org.xml.sax.SAXException
ToSAXHandlercomment in interface ExtendedLexicalHandlercomment in class ToSAXHandlerdata - the comment, but unlike the SAX comment() method this
method takes a String rather than a character array.org.xml.sax.SAXExceptionExtendedLexicalHandler.comment(String)public java.util.Properties getOutputFormat()
SerializerSerializer.getOutputFormat()public java.io.OutputStream getOutputStream()
SerializerSerializer.getOutputStream()public java.io.Writer getWriter()
SerializerSerializer.getWriter()public void indent(int n)
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionpublic boolean reset()
ToSAXHandlerreset in interface Serializerreset in class ToSAXHandlerSerializer.reset()public void serialize(org.w3c.dom.Node node)
throws java.io.IOException
SerializationHandlernode - the DOM node to be serialized.java.io.IOException - if an I/O exception occured while serializingDOMSerializer.serialize(Node)public boolean setEscaping(boolean escape)
SerializationHandlerescape - true if escaping is to be set on.SerializationHandler.setEscaping(boolean)public void setIndent(boolean indent)
SerializerBasesetIndent in class SerializerBaseindent - true if the output document should be indented to
visually indicate its structure.XSLOutputAttributes.setIndent(boolean)public void setOutputFormat(java.util.Properties format)
SerializerThe standard property keys supported are: "method", "version", "encoding", "omit-xml-declaration", "standalone", doctype-public", "doctype-system", "cdata-section-elements", "indent", "media-type". These property keys and their values are described in the XSLT recommendation, see XSLT 1.0 recommendation
The non-standard property keys supported are defined in OutputPropertiesFactory.
This method can be called multiple times before a document is serialized. Each time it is called more, or over-riding property values, can be specified. One property value that can not be changed is that of the "method" property key.
The value of the "cdata-section-elements" property key is a whitespace separated list of elements. If the element is in a namespace then value is passed in this format: {uri}localName
If the "cdata-section-elements" key is specified on multiple calls to this method the set of elements specified in the value is not replaced from one call to the next, but it is cumulative across the calls.
format - The output format to use, as a set of key/value pairs.Serializer.setOutputFormat(Properties)public void setOutputStream(java.io.OutputStream output)
Serializer
The encoding specified in the output Properties is used, or
if no encoding was specified, the default for the selected
output method.
Only one of setWriter() or setOutputStream() should be called.
output - The output streamSerializer.setOutputStream(OutputStream)public void setWriter(java.io.Writer writer)
Serializer
The encoding specified for the output Properties must be
identical to the output format used with the writer.
Only one of setWriter() or setOutputStream() should be called.
writer - The output writer streamSerializer.setWriter(Writer)public void addAttribute(java.lang.String uri,
java.lang.String localName,
java.lang.String rawName,
java.lang.String type,
java.lang.String value,
boolean XSLAttribute)
SerializerBaseaddAttribute in interface ExtendedContentHandleraddAttribute in class SerializerBaseuri - the URI of the attributelocalName - the local name of the attributerawName - the qualified name of the attributetype - the type of the attribute (probably CDATA)value - the value of the attributeXSLAttribute - true if this attribute is coming from an xsl:attriute elementExtendedContentHandler.addAttribute(String, String, String, String, String)public void attributeDecl(java.lang.String arg0,
java.lang.String arg1,
java.lang.String arg2,
java.lang.String arg3,
java.lang.String arg4)
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionDeclHandler.attributeDecl(String, String, String, String, String)public void elementDecl(java.lang.String arg0,
java.lang.String arg1)
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionDeclHandler.elementDecl(String, String)public void externalEntityDecl(java.lang.String arg0,
java.lang.String arg1,
java.lang.String arg2)
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionDeclHandler.externalEntityDecl(String, String, String)public void internalEntityDecl(java.lang.String arg0,
java.lang.String arg1)
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionDeclHandler.internalEntityDecl(String, String)public void endPrefixMapping(java.lang.String arg0)
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionContentHandler.endPrefixMapping(String)public void ignorableWhitespace(char[] arg0,
int arg1,
int arg2)
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionContentHandler.ignorableWhitespace(char[], int, int)public void processingInstruction(java.lang.String arg0,
java.lang.String arg1)
throws org.xml.sax.SAXException
processingInstruction in interface org.xml.sax.ContentHandlerprocessingInstruction in class ToSAXHandlerorg.xml.sax.SAXExceptionContentHandler.processingInstruction(String, String)public void setDocumentLocator(org.xml.sax.Locator arg0)
SerializerBasesetDocumentLocator in interface org.xml.sax.ContentHandlersetDocumentLocator in class SerializerBasearg0 - An object that can return the location of any SAX document
event.
Receive an object for locating the origin of SAX document events.
SAX parsers are strongly encouraged (though not absolutely required) to supply a locator: if it does so, it must supply the locator to the application by invoking this method before invoking any of the other methods in the DocumentHandler interface.
The locator allows the application to determine the end position of any document-related event, even if the parser is not reporting an error. Typically, the application will use this information for reporting its own errors (such as character content that does not match an application's business rules). The information returned by the locator is probably not sufficient for use with a search engine.
Note that the locator will return correct information only during the invocation of the events in this interface. The application should not attempt to use it at any other time.
ContentHandler.setDocumentLocator(Locator)public void skippedEntity(java.lang.String arg0)
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionContentHandler.skippedEntity(String)public void startElement(java.lang.String arg0,
java.lang.String arg1,
java.lang.String arg2,
org.xml.sax.Attributes arg3)
throws org.xml.sax.SAXException
ToSAXHandlerstartElement in interface org.xml.sax.ContentHandlerstartElement in class ToSAXHandlerorg.xml.sax.SAXExceptionContentHandler.startElement(String, String, String, Attributes)public void endCDATA()
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionLexicalHandler.endCDATA()public void endDTD()
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionLexicalHandler.endDTD()public void startCDATA()
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionLexicalHandler.startCDATA()public void startEntity(java.lang.String arg0)
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionLexicalHandler.startEntity(String)public void startElement(java.lang.String elementNamespaceURI,
java.lang.String elementLocalName,
java.lang.String elementName)
throws org.xml.sax.SAXException
startElement in interface ExtendedContentHandlerstartElement in class ToSAXHandlerelementNamespaceURI - the URI of the namespace of the element (optional)elementLocalName - the element name, but without prefix (optional)elementName - the element name, with prefix, if any (required)org.xml.sax.SAXExceptionExtendedContentHandler.startElement(String)public void startElement(java.lang.String elementName)
throws org.xml.sax.SAXException
ToSAXHandlerstartElement in interface ExtendedContentHandlerstartElement in class ToSAXHandlerelementName - the element name, with prefix (if any).org.xml.sax.SAXExceptionExtendedContentHandler.startElement(String)public void endDocument()
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionContentHandler.endDocument()public void characters(java.lang.String characters)
throws org.xml.sax.SAXException
ToSAXHandlercharacters in interface ExtendedContentHandlercharacters in class ToSAXHandlercharacters - The string of characters to process.org.xml.sax.SAXExceptionExtendedContentHandler.characters(String)public void characters(char[] characters,
int offset,
int length)
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionContentHandler.characters(char[], int, int)public void addAttribute(java.lang.String name,
java.lang.String value)
addAttribute in interface ExtendedContentHandleraddAttribute in class SerializerBasename - the attribute's qualified namevalue - the value of the attributepublic boolean startPrefixMapping(java.lang.String prefix,
java.lang.String uri,
boolean shouldFlush)
throws org.xml.sax.SAXException
ExtendedContentHandlerprefix - 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.org.xml.sax.SAXExceptionpublic void startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionpublic void namespaceAfterStartElement(java.lang.String prefix,
java.lang.String uri)
throws org.xml.sax.SAXException
SerializerBasenamespaceAfterStartElement in interface ExtendedContentHandlernamespaceAfterStartElement in class SerializerBaseprefix - the URI of the namespaceuri - the prefix associated with the given URI.org.xml.sax.SAXExceptionExtendedContentHandler.namespaceAfterStartElement(String, String)Copyright © 2023 Apache XML Project. All Rights Reserved.