This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Beginner Seeking Help With XML Parsing

 
Russ Russell
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Paul Clapham
Sheriff
Posts: 21128
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

http://www.totheriver.com/learn/xml/xmltutorial.html
 
Nishant Modak
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone interested in learning about the eXtensible Markup Language (XML) should read material at:

http://xml.coverpages.org/

Enjoy!
 
salvin francis
Bartender
Posts: 1277
10
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic