This utility method returns true if and only if this reader is currently inside a non-empty include element.
This utility method returns true if and only if this reader is
currently inside a non-empty include element. (This is not the
same as being inside the node set which replaces the include element.)
This is primarily needed for comments inside include elements.
It must be checked by the actual LexicalHandler
to see whether
a comment is passed or not.
boolean
This is a SAX filter which resolves all XInclude include elements before passing them on to the client application. Currently this class has the following known deviation from the XInclude specification:
Furthermore, I would definitely use a new instance of this class for each document you want to process. I doubt it can be used successfully on multiple documents. Furthermore, I can virtually guarantee that this class is not thread safe. You have been warned.
Since this class is not designed to be subclassed, and since I have not yet considered how that might affect the methods herein or what other protected methods might be needed to support subclasses, I have declared this class final. I may remove this restriction later, though the use-case for subclassing is weak. This class is designed to have its functionality extended via a horizontal chain of filters, not a vertical hierarchy of sub and superclasses.
To use this class:
XIncludeFilter
object with a known base URLXMLReader
object from which the raw document will be read to thesetParent()
method of this object.ContentHandler
object to thesetContentHandler()
method of this object. This is the object which will receive events from the parsed and included document.LexicalHandler
object as the value of this object'shttp://xml.org/sax/properties/lexical-handler
property. Also make sure yourLexicalHandler
asks this object for the status of each comment usinginsideIncludeElement
before doing anything with the comment.parse()
methode.g.
translated from Elliotte Rusty Harold's Java source.