Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Beginner Seeking Help With XML Parsing

 
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!
 
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.
 
Marshal
Posts: 25682
69
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
 
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.
 
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!
 
Saloon Keeper
Posts: 2625
128
Google Web Toolkit Eclipse IDE 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.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic