[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

"SAX2 Namespace Support" Configuration Example

  • From: Michael Fuller <msf@i...>
  • To: XML-DEV <xml-dev@x...>
  • Date: Fri, 25 Feb 2000 10:32:02 +1100

sax2 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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.