[
Lists Home |
Date Index |
Thread Index
]
- From: terje@in-progress.com (Terje Norderhaug)
- To: "xml-dev@xml.org" <xml-dev@xml.org>
- Date: Sun, 6 Feb 2000 19:19:48 -0800
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@in-progress.com> | 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!
|