Overview | Package | Class | Use | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## gnu.xml.pipeline
Class XIncludeFilter

    java.lang.Object
      |
      +--gnu.xml.pipeline.EventFilter
            |
            +--gnu.xml.pipeline.XIncludeFilter

All Implemented Interfaces:
  ContentHandler, DeclHandler, DTDHandler, EventConsumer, LexicalHandler, Locator

public class XIncludeFilter
extends EventFilter
implements Locator

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:

- URIs must not include fragment identifiers. XInclude (current WDs) specifies the use of XPointer, which is a high overhead non-streaming API.
- DTDs are not supported in included files, since the SAX DTD events must have completely preceded any included file. Also, the XInclude draft is incomplete in that area, because it doesn't say how it expects to "merge" DTD portions of the infoset with conflicting declarations.

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.

Version:
  $Date: 2001/10/25 07:32:04 $
Author:
  David Brownell

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

### XIncludeFilter

    public XIncludeFilter(EventConsumer next)
                   throws SAXException

Method Detail

### setDocumentLocator

    public void setDocumentLocator(Locator locator)

  Passes "this" down the filter chain as a proxy locator.
  Overrides:
    `setDocumentLocator` in class `EventFilter`
  Following copied from interface: `org.xml.sax.ContentHandler`
  Parameters:
    `locator` - An object that can return the location of any SAX document event.
  See Also:
    `Locator`

### getSystemId

    public java.lang.String getSystemId()

  Used for proxy locator; do not call directly.
  Specified by:
    `getSystemId` in interface `Locator`
  Following copied from interface: `org.xml.sax.Locator`
  Returns:
    A string containing the system identifier, or null if none is available.
  See Also:
    `Locator.getPublicId()`

### getPublicId

    public java.lang.String getPublicId()

  Used for proxy locator; do not call directly.
  Specified by:
    `getPublicId` in interface `Locator`
  Following copied from interface: `org.xml.sax.Locator`
  Returns:
    A string containing the public identifier, or null if none is available.
  See Also:
    `Locator.getSystemId()`

### getLineNumber

    public int getLineNumber()

  Used for proxy locator; do not call directly.
  Specified by:
    `getLineNumber` in interface `Locator`
  Following copied from interface: `org.xml.sax.Locator`
  Returns:
    The line number, or -1 if none is available.
  See Also:
    `Locator.getColumnNumber()`

### getColumnNumber

    public int getColumnNumber()

  Used for proxy locator; do not call directly.
  Specified by:
    `getColumnNumber` in interface `Locator`
  Following copied from interface: `org.xml.sax.Locator`
  Returns:
    The column number, or -1 if none is available.
  See Also:
    `Locator.getLineNumber()`

### setSavingPrefixes

    public void setSavingPrefixes(boolean flag)

  Assigns the flag controlling the setting of the SAX2 namespace-prefixes flag.

### 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.

### startDocument

    public void startDocument()
                       throws SAXException

  Description copied from class: `EventFilter`
  SAX2: passes this callback to the next consumer, if any
  Overrides:
    `startDocument` in class `EventFilter`
  Following copied from interface: `org.xml.sax.ContentHandler`
  Throws:
    `SAXException` - Any SAX exception, possibly wrapping another exception.
  See Also:
    `ContentHandler.endDocument()`

### endDocument

    public void endDocument()
                     throws SAXException

  Description copied from class: `EventFilter`
  SAX2: passes this callback to the next consumer, if any
  Overrides:
    `endDocument` in class `EventFilter`
  Following copied from interface: `org.xml.sax.ContentHandler`
  Throws:
    `SAXException` - Any SAX exception, possibly wrapping another exception.
  See Also:
    `ContentHandler.startDocument()`

### externalEntityDecl

    public void externalEntityDecl(java.lang.String name,
                                   java.lang.String publicId,
                                   java.lang.String systemId)
                            throws SAXException

  Description copied from class: `EventFilter`
  SAX2: passes this callback to the next consumer, if any
  Overrides:
    `externalEntityDecl` in class `EventFilter`
  Following copied from interface: `org.xml.sax.ext.DeclHandler`
  Parameters:
    `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.
  Throws:
    `SAXException` - The application may raise an exception.
  See Also:
    `DeclHandler.internalEntityDecl(java.lang.String, java.lang.String)`, `DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)`

### startEntity

    public void startEntity(java.lang.String name)
                     throws SAXException

  Description copied from class: `EventFilter`
  SAX2: passes this callback to the next consumer, if any.
  Overrides:
    `startEntity` in class `EventFilter`
  Following copied from interface: `org.xml.sax.ext.LexicalHandler`
  Parameters:
    `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]".
  Throws:
    `SAXException` - The application may raise an exception.
  See Also:
    `LexicalHandler.endEntity(java.lang.String)`, `DeclHandler.internalEntityDecl(java.lang.String, java.lang.String)`, `DeclHandler.externalEntityDecl(java.lang.String, java.lang.String, java.lang.String)`

### endEntity

    public void endEntity(java.lang.String name)
                   throws SAXException

  Description copied from class: `EventFilter`
  SAX2: passes this callback to the next consumer, if any.
  Overrides:
    `endEntity` in class `EventFilter`
  Following copied from interface: `org.xml.sax.ext.LexicalHandler`
  Parameters:
    `name` - The name of the entity that is ending.
  Throws:
    `SAXException` - The application may raise an exception.
  See Also:
    `LexicalHandler.startEntity(java.lang.String)`

### startElement

    public void startElement(java.lang.String uri,
                             java.lang.String localName,
                             java.lang.String qName,
                             Attributes atts)
                      throws SAXException

  Description copied from class: `EventFilter`
  SAX2: passes this callback to the next consumer, if any
  Overrides:
    `startElement` in class `EventFilter`
  Following copied from interface: `org.xml.sax.ContentHandler`
  Parameters:
    `uri` - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
    `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.
  Throws:
    `SAXException` - Any SAX exception, possibly wrapping another exception.
  See Also:
    `ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)`, `Attributes`

### endElement

    public void endElement(java.lang.String uri,
                           java.lang.String localName,
                           java.lang.String qName)
                    throws SAXException

  Description copied from class: `EventFilter`
  SAX2: passes this callback to the next consumer, if any
  Overrides:
    `endElement` in class `EventFilter`
  Following copied from interface: `org.xml.sax.ContentHandler`
  Parameters:
    `uri` - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
    `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.
  Throws:
    `SAXException` - Any SAX exception, possibly wrapping another exception.

### characters

    public void characters(char[] ch,
                           int start,
                           int length)
                    throws SAXException

  Description copied from class: `EventFilter`
  SAX2: passes this callback to the next consumer, if any
  Overrides:
    `characters` in class `EventFilter`
  Following copied from interface: `org.xml.sax.ContentHandler`
  Parameters:
    `ch` - The characters from the XML document.
    `start` - The start position in the array.
    `length` - 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)`, `Locator`

### processingInstruction

    public void processingInstruction(java.lang.String target,
                                      java.lang.String value)
                               throws SAXException

  Description copied from class: `EventFilter`
  SAX2: passes this callback to the next consumer, if any
  Overrides:
    `processingInstruction` in class `EventFilter`
  Following copied from interface: `org.xml.sax.ContentHandler`
  Parameters:
    `target` - The processing instruction target.
    `data` - 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.

### ignorableWhitespace

    public void ignorableWhitespace(char[] ch,
                                    int start,
                                    int length)
                             throws SAXException

  Description copied from class: `EventFilter`
  SAX2: passes this callback to the next consumer, if any
  Overrides:
    `ignorableWhitespace` in class `EventFilter`
  Following copied from interface: `org.xml.sax.ContentHandler`
  Parameters:
    `ch` - The characters from the XML document.
    `start` - The start position in the array.
    `length` - 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)`

### comment

    public void comment(char[] ch,
                        int start,
                        int length)
                 throws SAXException

  Description copied from class: `EventFilter`
  SAX2: passes this callback to the next consumer, if any
  Overrides:
    `comment` in class `EventFilter`
  Following copied from interface: `org.xml.sax.ext.LexicalHandler`
  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.

### startCDATA

    public void startCDATA()
                    throws SAXException

  Description copied from class: `EventFilter`
  SAX2: passes this callback to the next consumer, if any
  Overrides:
    `startCDATA` in class `EventFilter`
  Following copied from interface: `org.xml.sax.ext.LexicalHandler`
  Throws:
    `SAXException` - The application may raise an exception.
  See Also:
    `LexicalHandler.endCDATA()`

### endCDATA

    public void endCDATA()
                  throws SAXException

  Description copied from class: `EventFilter`
  SAX2: passes this callback to the next consumer, if any
  Overrides:
    `endCDATA` in class `EventFilter`
  Following copied from interface: `org.xml.sax.ext.LexicalHandler`
  Throws:
    `SAXException` - The application may raise an exception.
  See Also:
    `LexicalHandler.startCDATA()`

### startPrefixMapping

    public void startPrefixMapping(java.lang.String prefix,
                                   java.lang.String uri)
                            throws SAXException

  Description copied from class: `EventFilter`
  SAX2: passes this callback to the next consumer, if any
  Overrides:
    `startPrefixMapping` in class `EventFilter`
  Following copied from interface: `org.xml.sax.ContentHandler`
  Parameters:
    `prefix` - The Namespace prefix being declared.
    `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)`

### endPrefixMapping

    public void endPrefixMapping(java.lang.String prefix)
                          throws SAXException

  Description copied from class: `EventFilter`
  SAX2: passes this callback to the next consumer, if any
  Overrides:
    `endPrefixMapping` in class `EventFilter`
  Following copied from interface: `org.xml.sax.ContentHandler`
  Parameters:
    `prefix` - The prefix that was being mapping.
  Throws:
    `SAXException` - The client may throw an exception during processing.
  See Also:
    `ContentHandler.startPrefixMapping(java.lang.String, java.lang.String)`, `ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)`

### skippedEntity

    public void skippedEntity(java.lang.String name)
                       throws SAXException

  Description copied from class: `EventFilter`
  SAX2: passes this callback to the next consumer, if any
  Overrides:
    `skippedEntity` in class `EventFilter`
  Following copied from interface: `org.xml.sax.ContentHandler`
  Parameters:
    `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]".
  Throws:
    `SAXException` - Any SAX exception, possibly wrapping another exception.

Overview | Package | Class | Use | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | 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 2001-11-20.