• Post Reply Bookmark Topic Watch Topic
  • New Topic

Anyone using XML pull parsing?  RSS feed

 
William Stafford
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am contemplating using XML pull parsing to handle a SOAP message that contains a very complicated XML payload. Basically, I want to pull out a few elements and ignore the rest.

Pull parsing looks like a good choice but I have seen very little discussion of the technique. I would like to hear from people who have used this. I am especially interested in what tools and what pitfalls.

Thanks for any info or pointers,
-=beeky
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Tools: the javax.xml.stream package in Java 1.6 appears to be a complete implementation.
2. Problems: just as in SAX parsing, it is up to you the programmer to keep track of the document hierarchy in some sort of state machine logic.
3. Advantages over SAX - I can only think of two
* you dont have to fiddle with the SAX characters() method
* stopping parsing once the data is found is cleaner than throwing an exception in SAX

Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!