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
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<String, NamespaceHomonymResolver.Level> static final StringFields inherited from class eu.bandm.tools.util.xml.ContentProxy
out -
Constructor Summary
ConstructorsConstructorDescriptionCreate a SAX receiver which replaces all name space prefix mappings so that no nested homonyms occur. -
Method Summary
Modifier and TypeMethodDescriptionvoidendPrefixMapping(String prefix) protected StringmakeUnique(String s) voidstartPrefixMapping(String prefix, String uri) Methods inherited from class eu.bandm.tools.util.xml.ContentProxy
characters, endDocument, endElement, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElementMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
startPrefixMappingin interfaceContentHandler- Overrides:
startPrefixMappingin classContentProxy- Throws:
SAXException
-
endPrefixMapping
- Specified by:
endPrefixMappingin interfaceContentHandler- Overrides:
endPrefixMappingin classContentProxy- Throws:
SAXException
-