gnu.xml.pipeline
Class XIncludeFilter
java.lang.Object
|
+--gnu.xml.pipeline.EventFilter
|
+--gnu.xml.pipeline.XIncludeFilter
All Implemented Interfaces:
Locator, EventConsumer, ContentHandler, DTDHandler, LexicalHandler, DeclHandler
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 17-Sept-2002 CR draft of XInclude are as follows:
- URIs must not include fragment identifiers.
The CR specifies support for XPointer element() fragment IDs,
which is not currently implemented here.
- xi:fallback handling of resource errors is not
currently supported.
- DTDs are not supported in included files, since the SAX DTD events
must have completely preceded any included file.
The CR explicitly allows the DTD related portions of the infoset to
grow as an effect of including XML documents.
- xml:base fixup isn't done.
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
setSavingPrefixes(). You are strongly advised to do this.
Note that XInclude allows highly incompatible implementations, which
are specialized to handle application-specific infoset extensions. Some
such implementations can be implemented by subclassing this one, but
they may only be substituted in applications at "user option".
TBD: "IURI" handling.
Author: void | characters(char ch[][] , int start, int length)
|
void | comment(char ch[][] , int start, int length)
|
void | endCDATA()
|
void | endDocument()
|
void | endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
|
void | endEntity(java.lang.String name)
|
void | endPrefixMapping(java.lang.String prefix)
|
void | externalEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
|
int | getColumnNumber()
|
int | getLineNumber()
|
java.lang.String | getPublicId()
|
java.lang.String | getSystemId()
|
void | ignorableWhitespace(char ch[][] , int start, int length)
|
boolean | isSavingPrefixes()
|
void | processingInstruction(java.lang.String target, java.lang.String value)
|
void | setDocumentLocator(org.xml.sax.Locator locator)
|
void | setSavingPrefixes(boolean flag)
|
void | skippedEntity(java.lang.String name)
|
void | startCDATA()
|
void | startDocument()
|
void | startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
|
void | startEntity(java.lang.String name)
|
void | startPrefixMapping(java.lang.String prefix, java.lang.String uri)
|
XIncludeFilter
public XIncludeFilter(gnu.xml.pipeline.EventConsumer next)
Parameters:
characters
public void characters(char ch[][] , int start, int length)
Parameters:
comment
public void comment(char ch[][] , int start, int length)
Parameters:
endCDATA
public void endCDATA()
endDocument
public void endDocument()
endElement
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
Parameters:
endEntity
public void endEntity(java.lang.String name)
Parameters:
endPrefixMapping
public void endPrefixMapping(java.lang.String prefix)
Parameters:
externalEntityDecl
public void externalEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
Parameters:
getColumnNumber
public int getColumnNumber()
Used for proxy locator; do not call directly.
getLineNumber
public int getLineNumber()
Used for proxy locator; do not call directly.
getPublicId
public String getPublicId()
Used for proxy locator; do not call directly.
getSystemId
public String getSystemId()
Used for proxy locator; do not call directly.
ignorableWhitespace
public void ignorableWhitespace(char ch[][] , int start, int length)
Parameters:
isSavingPrefixes
public boolean isSavingPrefixes()
Returns the flag controlling the setting of the SAX2
namespace-prefixes flag when parsing included documents.
The default value is the SAX2 default (false), which discards
information that can be useful.
processingInstruction
public void processingInstruction(java.lang.String target, java.lang.String value)
Parameters:
setDocumentLocator
public void setDocumentLocator(org.xml.sax.Locator locator)
Passes "this" down the filter chain as a proxy locator.
Parameters:
setSavingPrefixes
public void setSavingPrefixes(boolean flag)
Assigns the flag controlling the setting of the SAX2
namespace-prefixes flag.
Parameters:
skippedEntity
public void skippedEntity(java.lang.String name)
Parameters:
startCDATA
public void startCDATA()
startDocument
public void startDocument()
startElement
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
Parameters:
startEntity
public void startEntity(java.lang.String name)
Parameters:
startPrefixMapping
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
Parameters:
#include
of C/C++ but works for XML documents as well as unparsed text files. Restrictions from the 17-Sept-2002 CR 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 setSavingPrefixes(). You are strongly advised to do this.
Note that XInclude allows highly incompatible implementations, which are specialized to handle application-specific infoset extensions. Some such implementations can be implemented by subclassing this one, but they may only be substituted in applications at "user option".
TBD: "IURI" handling.