Class NamespaceEmbedder

java.lang.Object
eu.bandm.tools.util.ContentProxy
eu.bandm.tools.util2.NamespaceEmbedder
All Implemented Interfaces:
ContentHandler

public class NamespaceEmbedder extends ContentProxy
Converts name space related information: (a) prefix mapping commands into pseudo-attributes, and (b) uri/localname sax events into qName sax events. This yields a "not-namespace-aware" format of the document.
The SAX event stream reaching this api must adhere to the following criteria
  • All names are by "uri" and "localname", --- the "qname" field is ignored.
  • All startPrefixMapping(String, String) and endPrefixMapping(String) calls are properly nested, ...
  • and in sync with the scopes, as defined by the carrying elements.
  • The prefix mappings are FREE of NESTED HOMONYMS (ie. the same prefix re-used for different uris, implying shadowing). Non-overlapping homonyms are permitted.
Cf. the SAX info at sax project api
The namespace uri "http://www.w3.org/XML/1998/namespace" is (a) bound to the prefix "xml:"; (b) it may be declared, but (c) it is not required to be declared. (d) This namespace name may not be bound to a different prefix, and (e) the prefix "xml:" may not be bound to a different namespace name. [NS in XML:3, last paras].