Package eu.bandm.tools.xslt.base
Class ForeignFilter
java.lang.Object
eu.bandm.tools.util.xml.ContentProxy
eu.bandm.tools.xslt.base.ForeignFilter
- All Implemented Interfaces:
ContentHandler
A
This is necessary because the [XSLT 1.0/sect 2.2] says "In addition, the xsl:stylesheet element may contain any element not from the XSLT namespace, provided that the expanded-name of the element has a non-null namespace URI."
Since a tdom model does not support this "lenient" behaviour, this filter can be prepepended if this behaviour is wanted. The second part ("non-null namespace URI.") is not checked, because it does not make any sense.
Assumes that all events are Namespace-Aware, ie. qName is IRRELEVANT!
ContentHandler
which suppresses all top-level elementes
which are not from the xslt namespace.
This is necessary because the [XSLT 1.0/sect 2.2] says "In addition, the xsl:stylesheet element may contain any element not from the XSLT namespace, provided that the expanded-name of the element has a non-null namespace URI."
Since a tdom model does not support this "lenient" behaviour, this filter can be prepepended if this behaviour is wanted. The second part ("non-null namespace URI.") is not checked, because it does not make any sense.
Assumes that all events are Namespace-Aware, ie. qName is IRRELEVANT!
-
Field Summary
Modifier and TypeFieldDescription(package private) final ContentHandler
(package private) final ContentHandler
(package private) int
protected final MessageReceiver<SimpleMessage<XMLDocumentIdentifier>>
Fields inherited from class eu.bandm.tools.util.xml.ContentProxy
out
-
Constructor Summary
ConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionvoid
endElement
(String uri, String localName, String qName) void
startElement
(String uri, String localName, String qName, Attributes attrs) Start element maintains a state machine for disposing top-level elements not from xslt.Methods inherited from class eu.bandm.tools.util.xml.ContentProxy
characters, endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
msg
-
level
int level -
consumer
-
disposer
-
-
Constructor Details
-
ForeignFilter
-
-
Method Details
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException Start element maintains a state machine for disposing top-level elements not from xslt.level = 0 means before start stylesheet
level = 1 means after start stylesheet, before xslt or foreign
level > 1 means IN foreign/xslt
level = 1 again -> listen again (for PIs, etc, and start elements!)- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classContentProxy
- Throws:
SAXException
-
endElement
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classContentProxy
- Throws:
SAXException
-