Package eu.bandm.tools.util.xml
Class NamespaceHomonymResolver
java.lang.Object
eu.bandm.tools.util.xml.ContentProxy
eu.bandm.tools.util.xml.NamespaceHomonymResolver
- All Implemented Interfaces:
ContentHandler
A
ContentHandler
which propagates all SAX events
but changes "start prefix mapping" and the corresponding
"end prefix mapping" iff HOMONMYS (=re-uses of prefices) are detected.
ASSUME that all SAX events passing through are in "namespace mode";
ie. get their identity from "localName" and "uri", NOT using qname/prefix!
The qname field is NOT adapted according to the calculated re-mapping
and must be ignored in all subsequent processing steps.
ASSUME that no prefix is re-used on THE SAME level of element nesting!
Because in this case the sequential order of the corresponding
"end prefix mapping" commands cannot be established.-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected final Map<String,
NamespaceHomonymResolver.Level> static final String
Fields inherited from class eu.bandm.tools.util.xml.ContentProxy
out
-
Constructor Summary
ConstructorDescriptionCreate a SAX receiver which replaces all name space prefix mappings so that no nested homonyms occur. -
Method Summary
Modifier and TypeMethodDescriptionvoid
endPrefixMapping
(String prefix) protected String
makeUnique
(String s) void
startPrefixMapping
(String prefix, String uri) Methods inherited from class eu.bandm.tools.util.xml.ContentProxy
characters, endDocument, endElement, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement
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
-
SUFFIX_SEPARATOR
- See Also:
-
current
-
currentPrefices
-
-
Constructor Details
-
NamespaceHomonymResolver
Create a SAX receiver which replaces all name space prefix mappings so that no nested homonyms occur.
-
-
Method Details
-
makeUnique
-
startPrefixMapping
- Specified by:
startPrefixMapping
in interfaceContentHandler
- Overrides:
startPrefixMapping
in classContentProxy
- Throws:
SAXException
-
endPrefixMapping
- Specified by:
endPrefixMapping
in interfaceContentHandler
- Overrides:
endPrefixMapping
in classContentProxy
- Throws:
SAXException
-