B.13. Namespace Information ItemsThese information items expose namespace identifiers and the prefixes currently used to associate element or attribute names with those identifiers. With SAX2, applications that track these prefixes need to use a stack to handle the lexical scoping rules: in the context of one element and its children, a prefix may indicate a different namespace than in parent elements because of a locally scoped redefinition. You can use the NamespaceSupport helper class to manage this stack or write something of your own. These information items start with a ContentHandler.startPrefixMapping() call and end with a ContentHandler.endPrefixMapping() call. These are the only two start/end calls that SAX2 doesn't require to be cleanly nested. Alternatively, if the namespaces feature flag is false, this information can be reconstructed from the xmlns and xmlns:* element attributes.
If the namespaces feature is set to false (its default is true) this information is not made available except implicitly through the element [attributes] property, which will implicitly include all [namespace attributes]. (It is illegal to set namespaces to false without setting namespace-prefixes to true.) Copyright © 2002 O'Reilly & Associates. All rights reserved. |
|