aspose file tools*
The moose likes XML and Related Technologies and the fly likes APIs or any wrapper over SAX to avoid dirty code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "APIs or any wrapper over SAX to avoid dirty code" Watch "APIs or any wrapper over SAX to avoid dirty code" New topic
Author

APIs or any wrapper over SAX to avoid dirty code

Rohit Kumar
Ranch Hand

Joined: Sep 20, 2007
Posts: 53
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 ]
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12823
    
    5
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

Joined: Sep 20, 2007
Posts: 53
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
Rancher

Joined: Mar 22, 2000
Posts: 12823
    
    5
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
 
Consider Paul's rocket mass heater.
 
subject: APIs or any wrapper over SAX to avoid dirty code