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

SAX survey: expected local name for non-namespace qualifiedelements

  • To: sax-devel@l...
  • Subject: SAX survey: expected local name for non-namespace qualifiedelements
  • From: Elliotte Rusty Harold <elharo@m...>
  • Date: Wed, 29 May 2002 12:32:06 -0400
  • Cc: xml-dev@l..., xerces-j-dev@x...
  • In-reply-to: <3CF4DA2A.9010006@t...>
  • References: <(Your message of "Tue, 28 May 2002 11:36:07 +0900.") <4.2.0.58.J.20020528113123.044b18f8@localhost><4.2.0.58.J.20020528184428.024936f8@localhost><3CF4DA2A.9010006@t...>

local name xml
Hello,

Recently I raised some issues about inconsistencies in the SAX 
documentation with regard to how local names are reported to the 
startElement() method:

public void startElement(java.lang.String uri,
                          java.lang.String localName,
                          java.lang.String qName,
                          Attributes atts)
                   throws SAXException

Specifically the question is, when namespace processing is turned on 
as it is by default (i.e. when http://xml.org/sax/features/namespaces 
is true), is it acceptable for a parser to report the local name of a 
non-namespace qualified element as the empty string? For example, 
consider this document with no namespaces:

<document>
   <para>
     Hello!
   </para>
<document>

When a parser calls startElement() or endElement() for these 
elements, is it allowed to report their local names as the empty 
string, and only provide the name as the qName argument? Or must it 
report the local names as "document" and "para"?

David Brownell, the current maintainer of SAX, surprised me by 
claiming that it is OK to report the local names as the empty string 
for non-qualified elements even when the namespaces feature is true. 
He says that such elements do not have local names.

I've checked with 4 existing parsers (Xerces-2, Piccolo, Crimson in 
JDK 1.4, and Oracle 9.0.2.0.2) and they all report the actual name as 
the local name argument. The SAX documentation is contradictory on 
this point. The infoset clearly states that non-namespace qualified 
elements do have local names, but the infoset is not normative for 
SAX.

Here is the question:

1. Before now, what was your understanding of this point? When 
writing and teaching did you tell your students to rely on local 
names or qNames for non-namespace qualified elements? What have you 
relied on in your code?

2. If you've implemented a parser, what does your parser do?

3. If you participated in the original specification of SAX2 back in 
1999/2000 what were you thinking about this then?


Note that the question is *not* what SAX should do now. The question 
is what was people's understanding of this point so that going 
forward we can be clearer about what is and is not conformant, and so 
that we can all write interoperable code. I'm trying to understand as 
much as possible what the original intent of SAX2 was, and I'm hoping 
that we don't discover that 50% of people understood it one way and 
50% understood it the opposite way, though that's certainly possible.

I've cc'd this to various people who have been involved in SAX in one 
way or another, as well as posting it to the sax-devel, xerces-j-dev, 
and xml-dev mailing lists. Discussion should probably take place on 
sax-devel <http://lists.sourceforge.net/lists/listinfo/sax-devel>, 
but it will where it will. Thanks for your input.

If you'd like to read the original exchange that led to this question 
see http://www.geocrawler.com/lists/3/SourceForge/13179/0/ and start 
with the first post on "misleading sentence on project page"
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@m... | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
|             http://www.cafeconleche.org/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |
+----------------------------------+---------------------------------+

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.