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

RE: RFC for XML Object Parsing

  • From: Brian Aberle <xmlboss@live.com>
  • To: Amelia A Lewis <amyzing@talsever.com>
  • Date: Mon, 24 Mar 2014 14:52:48 -0600

RE:  RFC for XML Object Parsing
Amy,
 
SAX should be calling all your handlers in the order that they appear in the XML, what folks do in thier handlers in their business.  Why should the SAX calls come out of order?  SAX does not pre-read them into a list then feed them to the application programmer. 
 
For writing, it may vary from one implementation to another, as I said.  Regardless, this does not create a crisis for anybody.  The "oid" can be ignored at any level as unwanted 'extra' data.  Ignoring it is easy.  Acting on it is a choice, at a very low level, a choice that opens up new possibilities.
 
The reason it is first, is because the only way we can parse directly to the intended destination is if we can find it first.  If we were to support this optimization with "oid" in the 2nd position, where would we put data until we knew where to put it - or implemented another way, should we parse all the attributes to discover that there is no "oid"? then we would have to back up and reparse if we found it, because now we have a destination.  It's first because it's most streamlined that way, and that is after all the whole purpose of the whole idea.  It was a good question and I hope that this explains it.
 
Brian
 
> Date: Mon, 24 Mar 2014 16:23:52 -0400
> From: amyzing@talsever.com
> To: xmlboss@l...
> CC: xml-dev@l...
> Subject: Re: FW: 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


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


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.