|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgnu.xml.pipeline.EventFilter
gnu.xml.pipeline.XIncludeFilter
public class XIncludeFilter
Filter to process an XPointer-free subset of
XInclude, supporting its
use as a kind of replacement for parsed general entities.
XInclude works much like the #include
of C/C++ but
works for XML documents as well as unparsed text files.
Restrictions from the 16-May-2001 draft of XInclude are as follows:
XML documents that are included will normally be processed using
the default SAX namespace rules, meaning that prefix information may
be discarded. This may be changed with setSavingPrefixes()
.
TBD: "IURI" handling.
Field Summary |
---|
Fields inherited from class gnu.xml.pipeline.EventFilter |
---|
DECL_HANDLER, FEATURE_URI, LEXICAL_HANDLER, PROPERTY_URI |
Constructor Summary | |
---|---|
XIncludeFilter(EventConsumer next)
|
Method Summary | |
---|---|
void |
characters(char[] ch,
int start,
int length)
SAX2: passes this callback to the next consumer, if any |
void |
comment(char[] ch,
int start,
int length)
SAX2: passes this callback to the next consumer, if any |
void |
endCDATA()
SAX2: passes this callback to the next consumer, if any |
void |
endDocument()
SAX2: passes this callback to the next consumer, if any |
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
SAX2: passes this callback to the next consumer, if any |
void |
endEntity(java.lang.String name)
SAX2: passes this callback to the next consumer, if any. |
void |
endPrefixMapping(java.lang.String prefix)
SAX2: passes this callback to the next consumer, if any |
void |
externalEntityDecl(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
SAX2: passes this callback to the next consumer, if any |
int |
getColumnNumber()
Used for proxy locator; do not call directly. |
int |
getLineNumber()
Used for proxy locator; do not call directly. |
java.lang.String |
getPublicId()
Used for proxy locator; do not call directly. |
java.lang.String |
getSystemId()
Used for proxy locator; do not call directly. |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
SAX2: passes this callback to the next consumer, if any |
boolean |
isSavingPrefixes()
Returns the flag controlling the setting of the SAX2 namespace-prefixes flag when parsing included documents. |
void |
processingInstruction(java.lang.String target,
java.lang.String value)
SAX2: passes this callback to the next consumer, if any |
void |
setDocumentLocator(Locator locator)
Passes "this" down the filter chain as a proxy locator. |
void |
setSavingPrefixes(boolean flag)
Assigns the flag controlling the setting of the SAX2 namespace-prefixes flag. |
void |
skippedEntity(java.lang.String name)
SAX2: passes this callback to the next consumer, if any |
void |
startCDATA()
SAX2: passes this callback to the next consumer, if any |
void |
startDocument()
SAX2: passes this callback to the next consumer, if any |
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
Attributes atts)
SAX2: passes this callback to the next consumer, if any |
void |
startEntity(java.lang.String name)
SAX2: passes this callback to the next consumer, if any. |
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
SAX2: passes this callback to the next consumer, if any |
Methods inherited from class gnu.xml.pipeline.EventFilter |
---|
attributeDecl, bind, chainTo, elementDecl, endDTD, getContentHandler, getDocumentLocator, getDTDHandler, getErrorHandler, getNext, getProperty, internalEntityDecl, notationDecl, setContentHandler, setDTDHandler, setErrorHandler, setProperty, startDTD, unparsedEntityDecl |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XIncludeFilter(EventConsumer next) throws SAXException
SAXException
Method Detail |
---|
public void setDocumentLocator(Locator locator)
setDocumentLocator
in interface ContentHandler
setDocumentLocator
in class EventFilter
locator
- An object that can return the location of
any SAX document event.Locator
public java.lang.String getSystemId()
getSystemId
in interface Locator
Locator.getPublicId()
public java.lang.String getPublicId()
getPublicId
in interface Locator
Locator.getSystemId()
public int getLineNumber()
getLineNumber
in interface Locator
Locator.getColumnNumber()
public int getColumnNumber()
getColumnNumber
in interface Locator
Locator.getLineNumber()
public void setSavingPrefixes(boolean flag)
public boolean isSavingPrefixes()
public void startDocument() throws SAXException
EventFilter
startDocument
in interface ContentHandler
startDocument
in class EventFilter
SAXException
- Any SAX exception, possibly
wrapping another exception.ContentHandler.endDocument()
public void endDocument() throws SAXException
EventFilter
endDocument
in interface ContentHandler
endDocument
in class EventFilter
SAXException
- Any SAX exception, possibly
wrapping another exception.ContentHandler.startDocument()
public void externalEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws SAXException
EventFilter
externalEntityDecl
in interface DeclHandler
externalEntityDecl
in class EventFilter
name
- The name of the entity. If it is a parameter
entity, the name will begin with '%'.publicId
- The declared public identifier of the entity, or
null if none was declared.systemId
- The declared system identifier of the entity.
SAXException
- The application may raise an exception.DeclHandler.internalEntityDecl(java.lang.String, java.lang.String)
,
DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public void startEntity(java.lang.String name) throws SAXException
EventFilter
startEntity
in interface LexicalHandler
startEntity
in class EventFilter
name
- 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]".
SAXException
- The application may raise an exception.LexicalHandler.endEntity(java.lang.String)
,
DeclHandler.internalEntityDecl(java.lang.String, java.lang.String)
,
DeclHandler.externalEntityDecl(java.lang.String, java.lang.String, java.lang.String)
public void endEntity(java.lang.String name) throws SAXException
EventFilter
endEntity
in interface LexicalHandler
endEntity
in class EventFilter
name
- The name of the entity that is ending.
SAXException
- The application may raise an exception.LexicalHandler.startEntity(java.lang.String)
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, Attributes atts) throws SAXException
EventFilter
startElement
in interface ContentHandler
startElement
in class EventFilter
localName
- The local name (without prefix), or the
empty string if Namespace processing is not being
performed.qName
- The qualified name (with prefix), or the
empty string if qualified names are not available.atts
- The attributes attached to the element. If
there are no attributes, it shall be an empty
Attributes object.
SAXException
- Any SAX exception, possibly
wrapping another exception.ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)
,
Attributes
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws SAXException
EventFilter
endElement
in interface ContentHandler
endElement
in class EventFilter
localName
- The local name (without prefix), or the
empty string if Namespace processing is not being
performed.qName
- The qualified XML 1.0 name (with prefix), or the
empty string if qualified names are not available.
SAXException
- Any SAX exception, possibly
wrapping another exception.public void characters(char[] ch, int start, int length) throws SAXException
EventFilter
characters
in interface ContentHandler
characters
in class EventFilter
ch
- The characters from the XML document.start
- The start position in the array.length
- The number of characters to read from the array.
SAXException
- Any SAX exception, possibly
wrapping another exception.ContentHandler.ignorableWhitespace(char[], int, int)
,
Locator
public void processingInstruction(java.lang.String target, java.lang.String value) throws SAXException
EventFilter
processingInstruction
in interface ContentHandler
processingInstruction
in class EventFilter
target
- The processing instruction target.value
- The processing instruction data, or null if
none was supplied. The data does not include any
whitespace separating it from the target.
SAXException
- Any SAX exception, possibly
wrapping another exception.public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
EventFilter
ignorableWhitespace
in interface ContentHandler
ignorableWhitespace
in class EventFilter
ch
- The characters from the XML document.start
- The start position in the array.length
- The number of characters to read from the array.
SAXException
- Any SAX exception, possibly
wrapping another exception.ContentHandler.characters(char[], int, int)
public void comment(char[] ch, int start, int length) throws SAXException
EventFilter
comment
in interface LexicalHandler
comment
in class EventFilter
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.
SAXException
- The application may raise an exception.public void startCDATA() throws SAXException
EventFilter
startCDATA
in interface LexicalHandler
startCDATA
in class EventFilter
SAXException
- The application may raise an exception.LexicalHandler.endCDATA()
public void endCDATA() throws SAXException
EventFilter
endCDATA
in interface LexicalHandler
endCDATA
in class EventFilter
SAXException
- The application may raise an exception.LexicalHandler.startCDATA()
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws SAXException
EventFilter
startPrefixMapping
in interface ContentHandler
startPrefixMapping
in class EventFilter
prefix
- The Namespace prefix being declared.uri
- The Namespace URI the prefix is mapped to.
SAXException
- The client may throw
an exception during processing.ContentHandler.endPrefixMapping(java.lang.String)
,
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
public void endPrefixMapping(java.lang.String prefix) throws SAXException
EventFilter
endPrefixMapping
in interface ContentHandler
endPrefixMapping
in class EventFilter
prefix
- The prefix that was being mapping.
SAXException
- The client may throw
an exception during processing.ContentHandler.startPrefixMapping(java.lang.String, java.lang.String)
,
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)
public void skippedEntity(java.lang.String name) throws SAXException
EventFilter
skippedEntity
in interface ContentHandler
skippedEntity
in class EventFilter
name
- 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]".
SAXException
- Any SAX exception, possibly
wrapping another exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Source code is under GPL (with library exception) in the JAXP project at http://www.gnu.org/software/classpathx/jaxp
This documentation was derived from that source code on 2012-01-06.