Re: FW: [xml-dev] RFC for XML Object Parsing

From
Amelia A Lewis <>
To
Brian Aberle <>
Date
2014-03-24T20:23:52Z
ID
<>
Thread
Re: FW: [xml-dev] RFC for XML Object Parsing
On Mon, 24 Mar 2014 14:03:02 -0600, Brian Aberle wrote:
> You said, 
>> You do realize that this means "this is not XML"?
>> 
>> You can't even guarantee attribute order in SAX. Suggesting that 
>> attribute order matters is pretty baffling, altogether.
>
> While Reading via SAX the attribute order will be detectable.

No. They. Won't.

See: http://www.saxproject.org/apidoc/org/xml/sax/Attributes.html

"The order of attributes in the list is unspecified, and will vary from 
implementation to implementation."

See also: 
http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html#startElement(java.lang.String,%20java.lang.String,%20java.lang.String,%20org.xml.sax.Attributes)

> While 
> Writing via SAX - I don't know, does that depend on parser 
> implementation?  Can anyone answer this? It could conceptually be XML 
> 2.0(100% backward compatible), or it could conceptually be "a 
> protocol", this is mostly a matter of view. 

I do not understand why you insist that it must be the first attribute, 
anyway. Just treat it specially. The collection of attributes is 
well-represented by an abstraction (in any programming language) that 
represents a set or a map, though the possibility of namespaced 
attributes complicates the construction of the key.

For your specific purpose, I cannot see why you don't just define 
ba:oid (where xmlns:ba="uri:something-that-you-own") and done. Then the 
specialized faster processing can check whether there's a ba:oid 
attribute on a particular element (or subtree) and treat it 
appropriately. Nothing terribly exciting to see, there.

No doubt I'm missing something. :-)

Amy!
-- 
Amelia A. Lewis                    amyzing {at} talsever.com
And now someone's on the telephone, desperate in his pain; 
someone's on the bathroom floor, doing her cocaine; 
someone's got his finger on the button in some room--
no one can convince me we aren't gluttons for our doom.
                -- Indigo Girls