• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAVA API to Read XML File?

 
Deepak Chopra
Ranch Hand
Posts: 433
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I want to read XML files using J2SE, I am confused whether should I treat the XML as text file and start reading OR Is there any JAVA API that can help me in that?
 
Petrus Pelser
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use either SAX or DOM.
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javax.xml package contains the related api. Googling "java xml parsers" will give you useful results.
 
Jolly Tiwari
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this link may give you some idea...

http://www.developer.com/xml/article.php/600801


Regards

Jolly
 
Rob Spoor
Sheriff
Pie
Posts: 20610
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JDOM is a well-known DOM library.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I actually prefer http://www.dom4j.org/

Both DOM and SAX are programming language agnostic APIs, which make them kind of awkward to use from a Java perspective (for example, they don't use Java collections were it would be appropriate).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic