OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   "SAX2 Namespace Support" Configuration Example

[ Lists Home | Date Index | Thread Index ]
  • From: Michael Fuller <msf@io.mds.rmit.edu.au>
  • To: XML-DEV <xml-dev@xml.org>
  • Date: Fri, 25 Feb 2000 10:32:02 +1100


_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@xml.org&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/threads.html
***************************************************************************




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS