• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

APIs or any wrapper over SAX to avoid dirty code

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am reading a huge xml file and writing elements to other file.
I am using SAX.
So are there any APIs or any wrapper over SAX so I can avoid the dirty code in SAX.

Thnaks in advance.
[ November 13, 2007: Message edited by: Yogesh G ]
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might be able to use one of the XML "pipeline" toolkits.

I wrote this survey article (pt 1) and part two as an introduction to pipeline style processing.

Bill
 
Rohit Kumar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I heard StAX as "DOM Ease with SAX Efficiency".
So Can i use StAX in this situation?
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
StAX is a "pull" parser as opposed to SAX which "pushes" events to your code. Some people find it conceptually easier to think about parsing this way and a StAX parser is easier to stop if you only need part of the data in the document.

You still have to write code to handle the specific "events" as the parser encounters each element of the XML document.

Did you look into the pipeline toolkits?

Bill
 
Yes, my master! Here is the tiny ad you asked for:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic