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

Re: Big XML file


splitting large xml files
Miguel A. Robles writes:

 > Many thanks for your help. Now, I know I can manage large XML files
 > with SAX and it works fine. The problem now exists when I need to
 > update the content of an element or any of its attributes. I'm not
 > sure, but I think that SAX cannot be used for that purpose.

SAX per se is just a common interface, and cannot do anything.
However, there are SAX clients (like my own XML-Writer and probably
many better ones) that take SAX events and generate XML markup from
them.  So if you take a SAX parser and register a SAX writer as its
client, you have an XML identity transformation with only a few lines
of code.

Now, create your own filter to sit between the parser and the writer.
All your filter has to do is intercept the events it wants to change
and generate new ones to replace them.  That may be an easy or
difficult task, depending on the scope of the changes (i.e. renaming
or splitting a few elements is easy, restructuring a large subtree
isn't).

Here's a link to XML-Writer:

  http://www.megginson.com/Software/xml-writer-0.2.zip

Here's information on SAX filters:

  http://www.saxproject.org/?selected=filters

There are several good books that discuss techniques for programming
with SAX in Java, including (but not limited to) one by David Brownell
and one by Elliotte Rusty Harold:

  http://www.amazon.com/exec/obidos/tg/detail/-/0596002378/104-1533715-6226366

  http://www.amazon.com/exec/obidos/tg/detail/-/0201771861/104-4997920-1035102


All the best,


David

-- 
David Megginson, david@m..., http://www.megginson.com/

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.