Class ToTextSAXHandler
- All Implemented Interfaces:
DOMSerializer,ExtendedContentHandler,ExtendedLexicalHandler,SerializationHandler,Serializer,ContentHandler,DTDHandler,ErrorHandler,DeclHandler,LexicalHandler
public final class ToTextSAXHandler extends ToSAXHandler
-
Field Summary
Fields Modifier and Type Field Description static StringCDATA_CONTINUETo insert ]]> in a CDATA section by ending the last CDATA section with ]] and starting the next CDATA section with >static StringCDATA_DELIMITER_CLOSEThe constant "]]>"static StringCDATA_DELIMITER_OPENstatic StringDEFAULT_SAX_SERIALIZERstatic StringEMPTYSTRINGstatic StringENTITY_AMPstatic StringENTITY_CRLFstatic StringENTITY_GTstatic StringENTITY_LTstatic StringENTITY_QUOTstatic StringXML_PREFIXstatic StringXMLNS_PREFIXstatic StringXMLNS_URIstatic StringXMLVERSION10static StringXMLVERSION11Define the XML version.Fields inherited from class org.apache.xml.serializer.ToSAXHandler
m_lexHandler, m_saxHandler, m_stateFields inherited from class org.apache.xml.serializer.SerializerBase
m_attrBuff, m_attributes, m_CdataElems, m_cdataTagOpen, m_charsBuff, m_doctypePublic, m_doctypeSystem, m_doIndent, m_elemContext, m_indentAmount, m_inEntityRef, m_inExternalDTD, m_mediatype, m_needToCallStartDocument, m_prefixMap, m_shouldNotWriteXMLHeader, m_sourceLocator, m_standaloneWasSpecified, m_StringOfCDATASections, m_tracer, m_version, m_writer, PKG_NAME, PKG_PATHFields inherited from interface org.apache.xml.serializer.ExtendedContentHandler
HTML_ATTREMPTY, HTML_ATTRURL, NO_BAD_CHARS -
Constructor Summary
Constructors Constructor Description ToTextSAXHandler(ContentHandler handler, String encoding)Deprecated.From XSLTCToTextSAXHandler(ContentHandler hdlr, LexicalHandler lex, String encoding)Deprecated. -
Method Summary
Modifier and Type Method Description voidaddAttribute(String name, String value)Deprecated.From XSLTCvoidaddAttribute(String uri, String localName, String rawName, String type, String value, boolean XSLAttribute)Deprecated.Adds the given attribute to the set of collected attributes , but only if there is a currently open element.voidattributeDecl(String arg0, String arg1, String arg2, String arg3, String arg4)Deprecated.Report an attribute type declaration.voidcharacters(char[] characters, int offset, int length)Deprecated.Receive notification of character data.voidcharacters(String characters)Deprecated.Receive notification of character data.voidcomment(char[] ch, int start, int length)Deprecated.Report an XML comment anywhere in the document.voidcomment(String data)Deprecated.Receive notification of a comment.voidelementDecl(String arg0, String arg1)Deprecated.Report an element type declaration.voidendCDATA()Deprecated.Report the end of a CDATA section.voidendDocument()Deprecated.From XSLTCvoidendDTD()Deprecated.Report the end of DTD declarations.voidendElement(String elemName)Deprecated.From XSLTCvoidendElement(String arg0, String arg1, String arg2)Deprecated.Receive notification of the end of an element.voidendPrefixMapping(String arg0)Deprecated.End the scope of a prefix-URI mapping.voidexternalEntityDecl(String arg0, String arg1, String arg2)Deprecated.Report a parsed external entity declaration.PropertiesgetOutputFormat()Deprecated.Returns the output format properties for this serializer.OutputStreamgetOutputStream()Deprecated.Get the output stream where the events will be serialized to.WritergetWriter()Deprecated.Get the character stream where the events will be serialized to.voidignorableWhitespace(char[] arg0, int arg1, int arg2)Deprecated.Receive notification of ignorable whitespace in element content.voidindent(int n)Deprecated.Does nothing because the indent attribute is ignored for text output.voidinternalEntityDecl(String arg0, String arg1)Deprecated.Report an internal entity declaration.voidnamespaceAfterStartElement(String prefix, 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().voidprocessingInstruction(String arg0, String arg1)Deprecated.From XSLTCbooleanreset()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).voidserialize(Node node)Deprecated.Notify that the serializer should take this DOM node as input to be serialized.voidsetDocumentLocator(Locator arg0)Deprecated.Receive an object for locating the origin of SAX document events.booleansetEscaping(boolean escape)Deprecated.Turns special character escaping on/off.voidsetIndent(boolean indent)Deprecated.Sets the value coming from the xsl:output indent stylesheet attribute.voidsetOutputFormat(Properties format)Deprecated.Specifies an output format for this serializer.voidsetOutputStream(OutputStream output)Deprecated.Specifies an output stream to which the document should be serialized.voidsetWriter(Writer writer)Deprecated.Specifies a writer to which the document should be serialized.voidskippedEntity(String arg0)Deprecated.Receive notification of a skipped entity.voidstartCDATA()Deprecated.Report the start of a CDATA section.voidstartElement(String elementName)Deprecated.An element starts, but attributes are not fully known yet.voidstartElement(String elementNamespaceURI, String elementLocalName, String elementName)Deprecated.From XSLTCvoidstartElement(String arg0, String arg1, String arg2, 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.voidstartEntity(String arg0)Deprecated.Report the beginning of some internal and external XML entities.voidstartPrefixMapping(String prefix, String uri)Deprecated.Begin the scope of a prefix-URI Namespace mapping.booleanstartPrefixMapping(String prefix, 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.Methods inherited from class org.apache.xml.serializer.ToSAXHandler
addUniqueAttribute, characters, closeCDATA, closeStartTag, error, fatalError, flushPending, setCdataSectionElements, setContentHandler, setLexHandler, setShouldOutputNSAttr, setTransformState, startDocumentInternal, startDTD, warningMethods inherited from class org.apache.xml.serializer.SerializerBase
addAttribute, addAttributeAlways, addAttributes, addXSLAttribute, asContentHandler, asDOM3Serializer, asDOMSerializer, close, documentIsEmpty, endEntity, entityReference, fireCDATAEvent, fireCharEvent, fireCommentEvent, fireEndDoc, fireEndElem, fireEndEntity, fireEntityReference, fireEscapingEvent, fireStartDoc, fireStartElem, fireStartEntity, getDoctypePublic, getDoctypeSystem, getEncoding, getIndent, getIndentAmount, getLocalName, getMediaType, getNamespaceMappings, getNamespaceURI, getNamespaceURIFromPrefix, getOmitXMLDeclaration, getOutputProperty, getOutputPropertyDefault, getOutputPropertyNonDefault, getPrefix, getPrefixPart, getStandalone, getTransformer, getVersion, initCDATA, isCdataSection, notationDecl, patchName, setDoctype, setDoctypePublic, setDoctypeSystem, setDTDEntityExpansion, setEncoding, setIndentAmount, setMediaType, setNamespaceMappings, setOmitXMLDeclaration, setOutputProperty, setOutputPropertyDefault, setSourceLocator, setStandalone, setStandaloneInternal, setTransformer, setVersion, startDocument, unparsedEntityDecl
-
Field Details
-
CDATA_CONTINUE
To insert ]]> in a CDATA section by ending the last CDATA section with ]] and starting the next CDATA section with >- See Also:
- Constant Field Values
-
CDATA_DELIMITER_CLOSE
The constant "]]>"- See Also:
- Constant Field Values
-
CDATA_DELIMITER_OPEN
- See Also:
- Constant Field Values
-
EMPTYSTRING
- See Also:
- Constant Field Values
-
ENTITY_AMP
- See Also:
- Constant Field Values
-
ENTITY_CRLF
- See Also:
- Constant Field Values
-
ENTITY_GT
- See Also:
- Constant Field Values
-
ENTITY_LT
- See Also:
- Constant Field Values
-
ENTITY_QUOT
- See Also:
- Constant Field Values
-
XML_PREFIX
- See Also:
- Constant Field Values
-
XMLNS_PREFIX
- See Also:
- Constant Field Values
-
XMLNS_URI
- See Also:
- Constant Field Values
-
DEFAULT_SAX_SERIALIZER
-
XMLVERSION11
Define the XML version.- See Also:
- Constant Field Values
-
XMLVERSION10
- See Also:
- Constant Field Values
-
-
Constructor Details
-
ToTextSAXHandler
Deprecated. -
ToTextSAXHandler
Deprecated.From XSLTC
-
-
Method Details
-
endElement
Deprecated.From XSLTC- Parameters:
elemName- the fully qualified element name.- Throws:
SAXException- See Also:
ExtendedContentHandler.endElement(String)
-
endElement
Deprecated.Description copied from interface:ContentHandlerReceive 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
startElementevent for every endElement event (even when the element is empty).For information on the names, see startElement.
- Parameters:
arg0- the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performedarg1- the local name (without prefix), or the empty string if Namespace processing is not being performedarg2- the qualified XML name (with prefix), or the empty string if qualified names are not available- Throws:
SAXException- any SAX exception, possibly wrapping another exception- See Also:
ContentHandler.endElement(String, String, String)
-
comment
Deprecated.Description copied from interface:LexicalHandlerReport 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).
- Parameters:
ch- An array holding the characters in the comment.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.
-
comment
Deprecated.Description copied from class:ToSAXHandlerReceive notification of a comment.- Specified by:
commentin interfaceExtendedLexicalHandler- Overrides:
commentin classToSAXHandler- Parameters:
data- the comment, but unlike the SAX comment() method this method takes a String rather than a character array.- Throws:
SAXException- See Also:
ExtendedLexicalHandler.comment(String)
-
getOutputFormat
Deprecated.Description copied from interface:SerializerReturns the output format properties for this serializer.- Returns:
- The output format key/value pairs in use.
- See Also:
Serializer.getOutputFormat()
-
getOutputStream
Deprecated.Description copied from interface:SerializerGet the output stream where the events will be serialized to.- Returns:
- reference to the result stream, or null if only a writer was set.
- See Also:
Serializer.getOutputStream()
-
getWriter
Deprecated.Description copied from interface:SerializerGet the character stream where the events will be serialized to.- Returns:
- Reference to the result Writer, or null.
- See Also:
Serializer.getWriter()
-
indent
Deprecated.Does nothing because the indent attribute is ignored for text output.- Throws:
SAXException
-
reset
public boolean reset()Deprecated.Description copied from class:ToSAXHandlerTry'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).- Specified by:
resetin interfaceSerializer- Overrides:
resetin classToSAXHandler- Returns:
- true if the class was successfuly reset.
- See Also:
Serializer.reset()
-
serialize
Deprecated.Description copied from interface:SerializationHandlerNotify that the serializer should take this DOM node as input to be serialized.- Parameters:
node- the DOM node to be serialized.- Throws:
IOException- if an I/O exception occured while serializing- See Also:
DOMSerializer.serialize(Node)
-
setEscaping
public boolean setEscaping(boolean escape)Deprecated.Description copied from interface:SerializationHandlerTurns special character escaping on/off. Note that characters will never, even if this option is set to 'true', be escaped within CDATA sections in output XML documents.- Parameters:
escape- true if escaping is to be set on.- See Also:
SerializationHandler.setEscaping(boolean)
-
setIndent
public void setIndent(boolean indent)Deprecated.Description copied from class:SerializerBaseSets the value coming from the xsl:output indent stylesheet attribute.- Overrides:
setIndentin classSerializerBase- Parameters:
indent- true if the output document should be indented to visually indicate its structure.- See Also:
XSLOutputAttributes.setIndent(boolean)
-
setOutputFormat
Deprecated.Description copied from interface:SerializerSpecifies an output format for this serializer. It the serializer has already been associated with an output format, it will switch to the new format. This method should not be called while the serializer is in the process of serializing a document.The 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 {@link 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.
- Parameters:
format- The output format to use, as a set of key/value pairs.- See Also:
Serializer.setOutputFormat(Properties)
-
setOutputStream
Deprecated.Description copied from interface:SerializerSpecifies an output stream to which the document should be serialized. This method should not be called while the serializer is in the process of serializing a document.The encoding specified in the output
Propertiesis used, or if no encoding was specified, the default for the selected output method.Only one of setWriter() or setOutputStream() should be called.
- Parameters:
output- The output stream- See Also:
Serializer.setOutputStream(OutputStream)
-
setWriter
Deprecated.Description copied from interface:SerializerSpecifies a writer to which the document should be serialized. This method should not be called while the serializer is in the process of serializing a document.The encoding specified for the output
Propertiesmust be identical to the output format used with the writer.Only one of setWriter() or setOutputStream() should be called.
- Parameters:
writer- The output writer stream- See Also:
Serializer.setWriter(Writer)
-
addAttribute
public void addAttribute(String uri, String localName, String rawName, String type, String value, boolean XSLAttribute)Deprecated.Description copied from class:SerializerBaseAdds the given attribute to the set of collected attributes , but only if there is a currently open element. An element is currently open if a startElement() notification has occured but the start of the element has not yet been written to the output. In the stream case this means that we have not yet been forced to close the elements opening tag by another notification, such as a character notification.- Specified by:
addAttributein interfaceExtendedContentHandler- Overrides:
addAttributein classSerializerBase- Parameters:
uri- 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 element- See Also:
ExtendedContentHandler.addAttribute(String, String, String, String, String)
-
attributeDecl
public void attributeDecl(String arg0, String arg1, String arg2, String arg3, String arg4) throws SAXExceptionDeprecated.Description copied from interface:DeclHandlerReport an attribute type declaration.Only the effective (first) declaration for an attribute will be reported. The type will be one of the strings "CDATA", "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", a parenthesized token group with the separator "|" and all whitespace removed, or the word "NOTATION" followed by a space followed by a parenthesized token group with all whitespace removed.
The value will be the value as reported to applications, appropriately normalized and with entity and character references expanded.
- Parameters:
arg0- The name of the associated element.arg1- The name of the attribute.arg2- A string representing the attribute type.arg3- A string representing the attribute defaulting mode ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if none of these applies.arg4- A string representing the attribute's default value, or null if there is none.- Throws:
SAXException- The application may raise an exception.- See Also:
DeclHandler.attributeDecl(String, String, String, String, String)
-
elementDecl
Deprecated.Description copied from interface:DeclHandlerReport an element type declaration.The content model will consist of the string "EMPTY", the string "ANY", or a parenthesised group, optionally followed by an occurrence indicator. The model will be normalized so that all parameter entities are fully resolved and all whitespace is removed,and will include the enclosing parentheses. Other normalization (such as removing redundant parentheses or simplifying occurrence indicators) is at the discretion of the parser.
- Parameters:
arg0- The element type name.arg1- The content model as a normalized string.- Throws:
SAXException- The application may raise an exception.- See Also:
DeclHandler.elementDecl(String, String)
-
externalEntityDecl
Deprecated.Description copied from interface:DeclHandlerReport a parsed external entity declaration.Only the effective (first) declaration for each entity will be reported.
If the system identifier is a URL, the parser must resolve it fully before passing it to the application.
- Parameters:
arg0- The name of the entity. If it is a parameter entity, the name will begin with '%'.arg1- The entity's public identifier, or null if none was given.arg2- The entity's system identifier.- Throws:
SAXException- The application may raise an exception.- See Also:
DeclHandler.externalEntityDecl(String, String, String)
-
internalEntityDecl
Deprecated.Description copied from interface:DeclHandlerReport an internal entity declaration.Only the effective (first) declaration for each entity will be reported. All parameter entities in the value will be expanded, but general entities will not.
- Parameters:
arg0- The name of the entity. If it is a parameter entity, the name will begin with '%'.arg1- The replacement text of the entity.- Throws:
SAXException- The application may raise an exception.- See Also:
DeclHandler.internalEntityDecl(String, String)
-
endPrefixMapping
Deprecated.Description copied from interface:ContentHandlerEnd the scope of a prefix-URI mapping.See
startPrefixMappingfor details. These events will always occur immediately after the correspondingendElementevent, but the order ofendPrefixMappingevents is not otherwise guaranteed.- Parameters:
arg0- the prefix that was being mapped. This is the empty string when a default mapping scope ends.- Throws:
SAXException- the client may throw an exception during processing- See Also:
ContentHandler.endPrefixMapping(String)
-
ignorableWhitespace
Deprecated.Description copied from interface:ContentHandlerReceive notification of ignorable whitespace in element content.Validating Parsers must use this method to report each chunk of whitespace in element content (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:
arg0- the characters from the XML documentarg1- the start position in the arrayarg2- the number of characters to read from the array- Throws:
SAXException- any SAX exception, possibly wrapping another exception- See Also:
ContentHandler.ignorableWhitespace(char[], int, int)
-
processingInstruction
Deprecated.From XSLTC- Specified by:
processingInstructionin interfaceContentHandler- Overrides:
processingInstructionin classToSAXHandler- Parameters:
arg0- the processing instruction targetarg1- the processing instruction data, or null if none was supplied. The data does not include any whitespace separating it from the target- Throws:
SAXException- any SAX exception, possibly wrapping another exception- See Also:
ContentHandler.processingInstruction(String, String)
-
setDocumentLocator
Deprecated.Description copied from class:SerializerBaseReceive an object for locating the origin of SAX document events.- Specified by:
setDocumentLocatorin interfaceContentHandler- Overrides:
setDocumentLocatorin classSerializerBase- Parameters:
arg0- 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.
- See Also:
ContentHandler.setDocumentLocator(Locator)
-
skippedEntity
Deprecated.Description copied from interface:ContentHandlerReceive notification of a skipped entity. This is not called for entity references within markup constructs such as element start tags or markup declarations. (The XML recommendation requires reporting skipped external entities. SAX also reports internal entity expansion/non-expansion, except within markup constructs.)The Parser will invoke this method each time the entity is skipped. Non-validating processors may skip entities if they have not seen the declarations (because, for example, the entity was declared in an external DTD subset). All processors may skip external entities, depending on the values of the
http://xml.org/sax/features/external-general-entitiesand thehttp://xml.org/sax/features/external-parameter-entitiesproperties.- Parameters:
arg0- the name of the skipped entity. If it is a parameter entity, the name will begin with '%', and if it is the external DTD subset, it will be the string "[dtd]"- Throws:
SAXException- any SAX exception, possibly wrapping another exception- See Also:
ContentHandler.skippedEntity(String)
-
startElement
public void startElement(String arg0, String arg1, String arg2, Attributes arg3) throws SAXExceptionDeprecated.Description copied from class:ToSAXHandlerReceive 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.- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classToSAXHandler- Parameters:
arg0- the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performedarg1- the local name (without prefix), or the empty string if Namespace processing is not being performedarg2- the qualified name (with prefix), or the empty string if qualified names are not availablearg3- the attributes attached to the element. If there are no attributes, it shall be an empty Attributes object. The value of this object after startElement returns is undefined- Throws:
SAXException- any SAX exception, possibly wrapping another exception- See Also:
ContentHandler.startElement(String, String, String, Attributes)
-
endCDATA
Deprecated.Description copied from interface:LexicalHandlerReport the end of a CDATA section.- Throws:
SAXException- The application may raise an exception.- See Also:
LexicalHandler.endCDATA()
-
endDTD
Deprecated.Description copied from interface:LexicalHandlerReport the end of DTD declarations.This method is intended to report the end of the DOCTYPE declaration; if the document has no DOCTYPE declaration, this method will not be invoked.
- Throws:
SAXException- The application may raise an exception.- See Also:
LexicalHandler.endDTD()
-
startCDATA
Deprecated.Description copied from interface:LexicalHandlerReport the start of a CDATA section.The contents of the CDATA section will be reported through the regular
charactersevent; this event is intended only to report the boundary.- Throws:
SAXException- The application may raise an exception.- See Also:
LexicalHandler.startCDATA()
-
startEntity
Deprecated.Description copied from interface:LexicalHandlerReport the beginning of some internal and external XML entities.The reporting of parameter entities (including the external DTD subset) is optional, and SAX2 drivers that report LexicalHandler events may not implement it; you can use the
http://xml.org/sax/features/lexical-handler/parameter-entitiesfeature to query or control the reporting of parameter entities.General entities are reported with their regular names, parameter entities have '%' prepended to their names, and the external DTD subset has the pseudo-entity name "[dtd]".
When a SAX2 driver is providing these events, all other events must be properly nested within start/end entity events. There is no additional requirement that events from
DeclHandlerorDTDHandlerbe properly ordered.Note that skipped entities will be reported through the
skippedEntityevent, which is part of the ContentHandler interface.Because of the streaming event model that SAX uses, some entity boundaries cannot be reported under any circumstances:
- general entities within attribute values
- parameter entities within declarations
These will be silently expanded, with no indication of where the original entity boundaries were.
Note also that the boundaries of character references (which are not really entities anyway) are not reported.
All start/endEntity events must be properly nested.
- Parameters:
arg0- The name of the entity. If it is a parameter entity, the name will begin with '%', and if it is the external DTD subset, it will be "[dtd]".- Throws:
SAXException- The application may raise an exception.- See Also:
LexicalHandler.startEntity(String)
-
startElement
public void startElement(String elementNamespaceURI, String elementLocalName, String elementName) throws SAXExceptionDeprecated.From XSLTC- Specified by:
startElementin interfaceExtendedContentHandler- Overrides:
startElementin classToSAXHandler- Parameters:
elementNamespaceURI- 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)- Throws:
SAXException- See Also:
ExtendedContentHandler.startElement(String)
-
startElement
Deprecated.Description copied from class:ToSAXHandlerAn element starts, but attributes are not fully known yet.- Specified by:
startElementin interfaceExtendedContentHandler- Overrides:
startElementin classToSAXHandler- Parameters:
elementName- the element name, with prefix (if any).- Throws:
SAXException- See Also:
ExtendedContentHandler.startElement(String)
-
endDocument
Deprecated.From XSLTC- Throws:
SAXException- any SAX exception, possibly wrapping another exception- See Also:
ContentHandler.endDocument()
-
characters
Deprecated.Description copied from class:ToSAXHandlerReceive notification of character data.- Specified by:
charactersin interfaceExtendedContentHandler- Overrides:
charactersin classToSAXHandler- Parameters:
characters- The string of characters to process.- Throws:
SAXException- See Also:
ExtendedContentHandler.characters(String)
-
characters
Deprecated.Description copied from interface:ContentHandlerReceive 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.
Individual characters may consist of more than one Java
charvalue. There are two important cases where this happens, because characters can't be represented in just sixteen bits. In one case, characters are represented in a Surrogate Pair, using two special Unicode values. Such characters are in the so-called "Astral Planes", with a code point above U+FFFF. A second case involves composite characters, such as a base character combining with one or more accent characters.Your code should not assume that algorithms using
char-at-a-time idioms will be working in character units; in some cases they will split characters. This is relevant wherever XML permits arbitrary characters, such as attribute values, processing instruction data, and comments as well as in data reported from this method. It's also generally relevant whenever Java code manipulates internationalized text; the issue isn't unique to XML.Note that some parsers will report whitespace in element content using the
ignorableWhitespacemethod rather than this one (validating parsers must do so).- Parameters:
characters- the characters from the XML documentoffset- the start position in the arraylength- the number of characters to read from the array- Throws:
SAXException- any SAX exception, possibly wrapping another exception- See Also:
ContentHandler.characters(char[], int, int)
-
addAttribute
Deprecated.From XSLTC- Specified by:
addAttributein interfaceExtendedContentHandler- Overrides:
addAttributein classSerializerBase- Parameters:
name- the attribute's qualified namevalue- the value of the attribute
-
startPrefixMapping
public boolean startPrefixMapping(String prefix, String uri, boolean shouldFlush) throws SAXExceptionDeprecated.Description copied from interface:ExtendedContentHandlerThis 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.- 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
-
startPrefixMapping
Deprecated.Description copied from interface:ContentHandlerBegin 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 the
http://xml.org/sax/features/namespacesfeature 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 corresponding
startElementevent, and allendPrefixMappingevents will occur immediately after the correspondingendElementevent, but their order is not otherwise guaranteed.There should never be start/endPrefixMapping events for the "xml" prefix, since it is predeclared and immutable.
- 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- See Also:
ContentHandler.endPrefixMapping(java.lang.String),ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
-
namespaceAfterStartElement
Deprecated.Description copied from class:SerializerBaseThis 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.- Specified by:
namespaceAfterStartElementin interfaceExtendedContentHandler- Overrides:
namespaceAfterStartElementin classSerializerBase- Parameters:
prefix- the URI of the namespaceuri- the prefix associated with the given URI.- Throws:
SAXException- See Also:
ExtendedContentHandler.namespaceAfterStartElement(String, String)
-
ToXMLSAXHandler.