Hi,
I've been programming in Java for a few years now, but I have no experience with parsing XML. I have tried some code snippets that I have found online with very little luck.
Where do I start with XML? Is there a specific API that I need? Can someone point me to some working code examples that will read an XML doc, and parse & display the results?
Thank you!
Mazer Lao Tzu
Ranch Hand
Joined: Jan 20, 2010
Posts: 35
posted
0
The most common API I have seen and used to parse XML is Apache's digester. I would recommend looking at that as a good start to parsing XML. Many of the posts in this forum should help you as well.
Digester the most common Java-XML API? I don't agree with this at all.
It's surprisingly difficult to use the obvious keywords of "java xml tutorial" to find a Java XML tutorial, but here's a reasonably good-looking one from the first page of the links I got:
If you haven't worked on any XML API. Would suggest you to briefly read through some tutorials which talk about JAXP, JAXB , DOM, SAX and Stax.
And then jump onto coding . It will help you come up to speed and use any API for that matter - once you 'get' a hang of what this is all about.
Jimmy Clark
Ranch Hand
Joined: Apr 16, 2008
Posts: 2187
posted
0
Anyone interested in learning about the eXtensible Markup Language (XML) should read material at:
Nishant Modak wrote:If you haven't worked on any XML API. Would suggest you to briefly read through some tutorials which talk about JAXP, JAXB , DOM, SAX and Stax.
And then jump onto coding . It will help you come up to speed and use any API for that matter - once you 'get' a hang of what this is all about.
I agree with the above post,
I found DOM to be great in the starting, but then SAX caught my eye,
There is an approach to parse XML (in SAX) to form your own beans using a stack, you might want to look at that.