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

Re: SAX2: Interning names in namespaces

  • From: terje@i... (Terje Norderhaug)
  • To: "xml-dev@x..." <xml-dev@x...>
  • Date: Sun, 6 Feb 2000 19:19:48 -0800

namespaceuri in startelement
At 6:33 PM 2/4/00, Terje Norderhaug wrote:
>At 10:59 AM 2/4/00, John Cowan wrote:
>>Terje Norderhaug wrote:
>
>My proposal is in essence that SAX2 establishes the following invariants:
>
>1. Two equal names are ALWAYS identical (==) if they are in the same namespace.
>2. Two equal names are NEVER identical if they are NOT in the same namespace.
>>
>>> Parts of the namespace handling in SAX can be simplified if it can assume
>>> that the parsers interns each name in its own namespace. It can eliminate
>>> the need for passing namespace information as a separate argument to
>>> methods or encoded in the name string.
>>
>>Unless there is a mechanism for recovering the namespace name from the
>>name, this will not work well, as application behavior will depend on
>>particular namespace names.
>
>Given that the invariant above holds, the namespace can be recovered from
>the name [...]

An important consequence is that SAX2 parsers don't have to pass the
namespaceURI with startElement and other events that takes a name as
argument. The SAX2 beta suggests the following expanded argument list for
startElement events in order to include namespace information:

  startElement(java.lang.String namespaceURI,
               java.lang.String localName,
               java.lang.String rawName,
               Attributes atts);

In SAX1, the startElement event is much cleaner, with only two arguments:

  startElement(java.lang.String name, AttributeList atts);

By instituting the proposal, SAX2 can continue to use the more
straight-forward argument lists of SAX1 while still support namespaces. One
of the benefits is that applications that use SAX1 may require few if any
modifications to continue to work under SAX2.


-- Terje <terje@i...> | Media Design in*Progress

   Software for Mac Web Professionals at <http://www.in-progress.com>
   Take advantage of XML with Emile, the first XML editor for Mac!



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.