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

XML. SAX. Streaming processing with Groves.

  • From: Paul Tchistopolskii <paul@q...>
  • To: xml-dev@i...
  • Date: Thu, 02 Dec 1999 21:05:39 -0800

sax streaming


The advantage of SAX ( and attributes in XML) 
is that we have attributes  in place when startElement 
is invoked. We know what are some properties of this 
element right when element begins.

At that point could we get the information about 
the another properties this element has
( the child elements ) ?

No. We can not. If we'l decide to read the entire 
element before infoking startElement() - we'l have
to read the entire ( root ) document to know. 
DOM does it.

How can we workaround this limitation?

Right now I'm writing yet another wrapper 
around SAX, accumulating the element contents  
in 'microDOM' and then making a descision in 
endElement()  what to do with the element 
itself depending on the values of his children.

The 'correct' approach to avoid such a hell 
is to use DOM - but I can't. Documents could 
be big. 

I also can not require the client to turn all their 
elements into attributes.

It's actualy very interesting. If one wants his 
XML documents to be easy to process 
without DOM he  should have as much attributes 
as it's possible ! 

<aside> 
Isn't it  the end of long discussion of Elements vs Attributes? 
Now when I see the question: "Should I use attributes or 
elements?" - I know the answer:

"If you want it to be processed by current APIs not keeping 
the entire docuemnt in the memory  - use attributes everywhere 
you can."
</aside>

What if  for *some*  elements parser would invoke 
startElement ( or endElement) *after*  reading the 
entire element and placing all the children into ... Grove) ?

I think I could specify  those 'return-as-grove' elements 
at runtime, or when I'm initializing the parser.

How easy is to it do with curent SAX design ?

Rgds.Paul.



xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@i... the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)



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.