www-128.ibm.com — The Streaming API for XML (StAX) is the latest standard for processing XML in the Java™ language. As a stream-oriented approach, it often proves a better alternative to other methods, such as DOM and SAX, both in terms of performance and usability. This article, the first in a three part series, provides an overview of StAX.
Nov 29, 2006 View in Crawl 4
centinallNov 30, 2006
SAX can also handle streams. But I've still heard that StAX will out perform SAX either way. Also, there's another way of handling XML and that's through binding, with such tools as JAXB.
marimoNov 30, 2006
Introducing Programming languages: The best ever guide<a class="user" href="http://just-humour.blogspot.com/2006/11/programming-languages-are-like-women-by.html">http://just-humour.blogspot.com/2006/11/programming-languages-are-like-women-by.html</a>
soopahmanNov 30, 2006
It's good to see people are still working on Java and XML - there's yet to be a good XML library for it - maybe this will be worthwhile.However, given it's 2006 and Java is still struggling to release a sensible standard library for this important technology, I doubt this is much better. Very sad really.For what it's worth, the .Net Framework has encouraged streaming over all-at-once coding since its initial release, and a class named XmlTextReader does a great job with streaming in XML in .Net in a very high-performing way. Java's showing its age.
fearnloathingNov 30, 2006
DOM parsing is extremely expensive in terms of CPU and memory. I would only recommend using it if you need the tree in memory. SAX is better if you're doing a 1 shot parse. Most times when people are doing XML parsing, SAX is what they should be using.
Closed AccountDec 1, 2006
And you're a douche bag.
Closed AccountDec 1, 2006
"Let's not forget our simple friend JDOM."Nice one, simpleton.
kstephensDec 2, 2006
For sparse documents in memory, time and CPU-constrained environments, event-based XML parsing is the way to go. "Sparse": meaning, you're given 10Mb XML of fatty-fat-fat XML SOAP crap and you are interested in only 1% of the content. To top it all off 80% of all XML is redundant fluff. I've had more than one case where an XML DOM was infeasible in a production environment. Expat and a tiny Perl state machine -- problem solved.RANT ON:XML is just Lisp S-expressions with ridiculously fat parentheses. The external data rep problem was solved by McCarthy 50 years ago and then again by XDR. Why the fark do we need both attributes *and* elements? XML is the 8-track audio tape of computing. Any other XML haters out there? I can't believe I'm the only one. :)RANT OFF.
dfekkeDec 7, 2006
I have a post on my blog about how to use this with ColdFusion;<a class="user" href="http://www.fekke.com/blog/index.cfm/2006/12/7/What-Jar-files-do-I-need-to-use-Stax">http://www.fekke.com/blog/index.cfm/2006/12/7/What-Jar-files-do-I-need-to-use-Stax</a>
tahsin352Sep 29, 2009
nice article, see my article on xml api on <a class="user" href="http://newdailyblog.blogspot.com/2009/09/api-for-xml.html" rel="nofollow">http://newdailyblog.blogspot.com/2009/09/api-for-x ...</a>