Java and XML, SAX or JDOM or XOM?!

S

steve_marjoribanks

I am writing a Java application which will view XML data and display it
graphically (within an engineering context) and also as an aside will
allow you to view the XML 'tree' structure. Obviously this will require
a fair amount of XML manipulation and so I was wondering what people
thought the most suitable API to use would be?
From what I can gather SAX or DOM and maybe JDOM are the most commonly
used, but the book I am currently reading regards XOM (www.xom.nu) very
highly as it is very strict in terms of only allowing valid XML etc.
and also is supposed to have a very shallow learning curve. Bearing in
mind I am a Java beginner, what do people think of the options?

Many thanks,
Steve
 
M

Michael Redlich

I am writing a Java application which will view XML data and display it
graphically (within an engineering context) and also as an aside will
allow you to view the XML 'tree' structure. Obviously this will require
a fair amount of XML manipulation and so I was wondering what people
thought the most suitable API to use would be?
used, but the book I am currently reading regards XOM (www.xom.nu) very
highly as it is very strict in terms of only allowing valid XML etc.
and also is supposed to have a very shallow learning curve. Bearing in
mind I am a Java beginner, what do people think of the options?

Many thanks,
Steve

Hi Steve:

There's a XML parsing utility called XMLtp that you can use. It was
originally developed in 1999 (before Java provided XML support) by
Thomas Weidenfeller, but it's still useful in terms of
checking/enforcing valid XML syntax. One of the examples is a GUI
application to display the tree structure that you need. Check out
http://mitglied.lycos.de/xmltp/ for more information and to download
the parser.

Sincerely,

Mike.

--- ACGNJ Java Users Group (http://www.javasig.org/)
 
S

steve_marjoribanks

Thanks for the information, I shall look into it but I'm not sure it's
exactly what I need (then again, what do I know!!?). Maybe I should
have better explained what the application will be.
Firstly I am thinking up a new standardized XML data structure for use
within a certain domain. I am then going to write two applications
which will use this data format.

The first one will be able to load a previously written XML data file
and display the data (related to slope stability) graphically (ie. a
pictorial representation).
The second one will be a sort of XPath/XPointer interactive visualiser
so the user will be able to see and explore the complicated XLinks
between various sections of the data.

Therefore, I think the API I use will need to be able to validate the
XML data against a schema file (not a DTD), be able to handle XPath as
well as all the 'normal' stuff.

Regards
Steve
 
M

Michael Redlich

Hi Steve:

Thanks for the updated information...

The first one will be able to load a previously written XML data file
and display the data (related to slope stability) graphically (ie. a
pictorial representation).

XMLtp would have been perfect for the first task....
The second one will be a sort of XPath/XPointer interactive visualiser
so the user will be able to see and explore the complicated XLinks
between various sections of the data.

However, not for the second...
Therefore, I think the API I use will need to be able to validate the
XML data against a schema file (not a DTD), be able to handle XPath as
well as all the 'normal' stuff.

Therefore, I would suggest using the Java API for XML Processing (JAXP)
1.3 which is included in J2SE 5.0. More details can be found at
http://java.sun.com/webservices/jaxp/index.jsp.

As I mentioned earlier, XMLtp was written before JAXP was developed.
The author, Thomas Weidenfeller, even stopped supporting XMLtp in 2001.
However, I think that it can still be useful as a learning tool and
for use in small applications that need to parse data stored in XML
format.

Sincerely,

Mike.

--- ACGNJ Java Users Group (http://www.javasig.org/)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top