[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] "SAX2 Namespace Support" Configuration Example
_SAX2 Namespace Support_, section 2 "Configuration Example" at: http://www.megginson.com/SAX/SAX2/namespaces.html reads: ------ Consider the following simple sample document: <?xml version="1.0"?> <h:hello xmlns:h="http://www.greeting.com/ns/" id="a1" h:person="David"/> [...] If namespaces is true and namespace-prefixes is true, then a SAX2 XML reader will report the following: * an element with the Namespace URI "http://www.greeting.com/ns/", the local name "hello", and the raw name "h:hello"; * an attribute with no Namespace URI (empty string), no local name (empty string), and the raw name "xmlns"; * an attribute with no Namespace URI (empty string), the local name "id", and the raw name "id"; and * an attribute with the Namespace URI "http://www.greeting.com/ns/", the local name "person", and the raw name "h:person". If namespaces is false and namespace-prefixes is true, then a SAX2 XML reader will report the following: * an element with the raw name "h:hello"; * an attribute with the raw name "xmlns"; * an attribute with the raw name "id"; and * an attribute with the raw name "h:person". ------ Question: in both cases, should the raw name of the xmlns attribute be "xmlns:h", not "xmlns"? Particularly in the false/true case, this seems the only way to be able to faithfully recreate the original XML 1.0 document... (Forgive me if this was debated and determined previously; a lot of water has flowed under the SAX namespace name/raw name bridge...) Michael Aside: I note that the JavaDoc of the Attributes interface refers to the "raw-names" feature and "http://xml.org/sax/features/raw-names", not namespace-prefixes. Aside 2: The _SAX2: Features and Properties_ document doesn't specify the defaults for the listed core features; however, other documents, such as _Namespace Support_ and the JavaDoc do talk about default values. Perhaps an extra line should be added to the description of each feature stating its default value? *************************************************************************** This is xml-dev, the mailing list for XML developers. To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev List archives are available at http://xml.org/archives/xml-dev/threads.html ***************************************************************************
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|