Fri, 22 Oct 2010 15:23:03 -0700, /Mark Brucks/:
Your example is still dealing with the interpretation of a prefix in an existing document, and I don't have an existing document. I am in control of which namespaces and which prefixes would be used.
As Michael has already pointed out the schema is the existing document which you would like to extract the prefixes from. I've previously needed such functionality and my approach was to iterate over the 'namespaceItems' of the built 'XSModel', then parse (using SAX) each 'XSNamespaceItem.documentLocations' only until reaching the root element (throwing something like StopParseException subtype of SAXParseException from withing 'startElement' callback) from which I extract whatever namespace prefixes found on it. The structure collecting the prefix-namespace bindings takes care to not register two or more namespaces to the same prefix. It also automatically generated prefixes for namespaces (appart from the registered default namespace which could be the no-namespace) which don't have prefix assigned later, in my case.
-- Stanimir --------------------------------------------------------------------- To unsubscribe, e-mail: j-users-unsubscr...@xerces.apache.org For additional commands, e-mail: j-users-h...@xerces.apache.org