org.xml.sax.ContentHandler
SerializationHandler
AdaptiveResultTreeImpl
, EmptySerializer
, SerializerBase
, SimpleResultTreeImpl
, StringValueHandler
, ToHTMLSAXHandler
, ToHTMLStream
, ToSAXHandler
, ToStream
, ToTextSAXHandler
, ToTextStream
, ToUnknownStream
, ToXMLSAXHandler
, ToXMLStream
public interface ExtendedContentHandler
extends org.xml.sax.ContentHandler
startElement(namespaceURI,localName,qName,atts)could be replaced with the calls
startElement(namespaceURI,localName,qName) addAttributes(atts)If there are no attributes the second call can be dropped. If attributes are to be added one at a time with calls to
addAttribute(namespaceURI, localName, qName, type, value)
Modifier and Type | Field | Description |
---|---|---|
static int |
HTML_ATTREMPTY |
|
static int |
HTML_ATTRURL |
|
static int |
NO_BAD_CHARS |
Modifier and Type | Method | Description |
---|---|---|
void |
addAttribute(java.lang.String qName,
java.lang.String value) |
Add an attribute to the current element.
|
void |
addAttribute(java.lang.String uri,
java.lang.String localName,
java.lang.String rawName,
java.lang.String type,
java.lang.String value) |
Add at attribute to the current element, not from an xsl:attribute
element.
|
void |
addAttribute(java.lang.String uri,
java.lang.String localName,
java.lang.String rawName,
java.lang.String type,
java.lang.String value,
boolean XSLAttribute) |
Add at attribute to the current element
|
void |
addAttributes(org.xml.sax.Attributes atts) |
Add attributes to the current element
|
void |
addUniqueAttribute(java.lang.String qName,
java.lang.String value,
int flags) |
Add a unique attribute to the current element.
|
void |
addXSLAttribute(java.lang.String qName,
java.lang.String value,
java.lang.String uri) |
Add an attribute from an xsl:attribute element.
|
void |
characters(java.lang.String chars) |
This method is used to notify of a character event, but passing the data
as a character String rather than the standard character array.
|
void |
characters(org.w3c.dom.Node node) |
This method is used to notify of a character event, but passing the data
as a DOM Node rather than the standard character array.
|
void |
endElement(java.lang.String elemName) |
This method is used to notify that an element has ended.
|
void |
entityReference(java.lang.String entityName) |
Notify of an entity reference.
|
NamespaceMappings |
getNamespaceMappings() |
This method returns an object that has the current namespace mappings in
effect.
|
java.lang.String |
getNamespaceURI(java.lang.String name,
boolean isElement) |
This method gets the prefix associated with a current element or
attribute name.
|
java.lang.String |
getNamespaceURIFromPrefix(java.lang.String prefix) |
This method returns the namespace URI currently associated with the
prefix.
|
java.lang.String |
getPrefix(java.lang.String uri) |
This method returns the prefix that currently maps to the given namespace
URI.
|
void |
namespaceAfterStartElement(java.lang.String uri,
java.lang.String prefix) |
This method is used to notify that a prefix mapping is to start, but
after an element is started.
|
void |
setSourceLocator(javax.xml.transform.SourceLocator locator) |
This method is used to set the source locator, which might be used to
generated an error message.
|
void |
startElement(java.lang.String qName) |
This method is used to notify of the start of an element
|
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName) |
This method is used to notify that an element is starting.
|
boolean |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri,
boolean shouldFlush) |
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.
|
static final int NO_BAD_CHARS
static final int HTML_ATTREMPTY
static final int HTML_ATTRURL
void addAttribute(java.lang.String uri, java.lang.String localName, java.lang.String rawName, java.lang.String type, java.lang.String value, boolean XSLAttribute) throws org.xml.sax.SAXException
uri
- the namespace URI of the attribute namelocalName
- the local name of the attribute (without prefix)rawName
- the qualified name of the attributetype
- the attribute type typically character data (CDATA)value
- the value of the attributeXSLAttribute
- true if the added attribute is coming from an xsl:attribute elementorg.xml.sax.SAXException
void addAttributes(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
atts
- the attributes to add.org.xml.sax.SAXException
void addAttribute(java.lang.String qName, java.lang.String value)
qName
- value
- void characters(java.lang.String chars) throws org.xml.sax.SAXException
chars
- the character dataorg.xml.sax.SAXException
void characters(org.w3c.dom.Node node) throws org.xml.sax.SAXException
node
- a DOM Node containing text.org.xml.sax.SAXException
void endElement(java.lang.String elemName) throws org.xml.sax.SAXException
endElement(namespaceURI,localName,qName)only the last parameter is passed. If needed the serializer can derive the localName from the qualified name and derive the namespaceURI from its implementation.
elemName
- the fully qualified element name.org.xml.sax.SAXException
void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
startElement(uri,localName,qname,atts)but without the attributes.
uri
- the namespace URI of the elementlocalName
- the local name (without prefix) of the elementqName
- the qualified name of the elementorg.xml.sax.SAXException
void startElement(java.lang.String qName) throws org.xml.sax.SAXException
qName
- the fully qualified name of the elementorg.xml.sax.SAXException
void namespaceAfterStartElement(java.lang.String uri, java.lang.String prefix) throws org.xml.sax.SAXException
startPrefixMapping(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")
uri
- the namespace URI being declaredprefix
- the prefix that maps to the given namespaceorg.xml.sax.SAXException
boolean startPrefixMapping(java.lang.String prefix, java.lang.String uri, boolean shouldFlush) throws org.xml.sax.SAXException
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.org.xml.sax.SAXException
void entityReference(java.lang.String entityName) throws org.xml.sax.SAXException
entityName
- the name of the entityorg.xml.sax.SAXException
NamespaceMappings getNamespaceMappings()
java.lang.String getPrefix(java.lang.String uri)
uri
- the namespace URIjava.lang.String getNamespaceURI(java.lang.String name, boolean isElement)
name
- the qualified name of an element, or attributeisElement
- true if it is an element name, false if it is an
atttribute namejava.lang.String getNamespaceURIFromPrefix(java.lang.String prefix)
prefix
- a prefix of an element or attribute.void setSourceLocator(javax.xml.transform.SourceLocator locator)
locator
- the source locatorvoid addUniqueAttribute(java.lang.String qName, java.lang.String value, int flags) throws org.xml.sax.SAXException
qName
- the fully qualified attribute name.value
- the attribute valueflags
- a bitwise flagorg.xml.sax.SAXException
void addXSLAttribute(java.lang.String qName, java.lang.String value, java.lang.String uri)
qName
- the qualified attribute name (prefix:localName)value
- the attributes valueuri
- the uri that the prefix of the qName is mapped to.void addAttribute(java.lang.String uri, java.lang.String localName, java.lang.String rawName, java.lang.String type, java.lang.String value) throws org.xml.sax.SAXException
uri
- the namespace URI of the attribute namelocalName
- the local name of the attribute (without prefix)rawName
- the qualified name of the attributetype
- the attribute type typically character data (CDATA)value
- the value of the attributeorg.xml.sax.SAXException
Copyright © 2014 Apache XML Project. All Rights Reserved.