A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
XML and Related Technologies
XML Filtering using XPath
Joined: Feb 05, 2008
Feb 08, 2009 01:15:52
I have a problem to solve. I need to filter very large XML documents using XPath. I need to provide a list of xpaths to generate a smaller versions of the documents. for example...
<aaa> <bbb>Hello</bbb> <ccc>123</ccc> </aaa> <zzz> <yyy> <xxx>David</xxx> <vvv>true</vvv> </yyy> </zzz>
<aaa> <bbb>Hello</bbb> </aaa> <zzz> <yyy> <xxx>David</xxx> <vvv>true</vvv> </yyy> </zzz>
What is a good way to do this using Java APIs?
Author and all-around good cowpoke
Joined: Mar 22, 2000
Feb 08, 2009 07:10:23
If your input XML document is truly "very large" - too large to get in memory as a DOM - the standard library XPath will not help you because it requires a DOM to work with.
For documents too big for DOM, you are stuck with some form of SAX or StAX parsing.
Harold's chapter on SAX filters
to be very helpful when thinking about big SAX problems.
You might find the
to be helpful.
Joined: Mar 19, 2005
Feb 09, 2009 17:21:05
How large an xml file william are we talking before looking into streaming xml instead of parsing as a DOM and using xpath and xquery to query the data?
I agree. Here's the link:
subject: XML Filtering using XPath
Xpath Requirement help!!
mysql & incomplete insertions!
A question on Xpath
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014