validate xml with a dtd in java

M

Mithil

Hi all,

I am new to xml, could some one please tell me how to validate xml
against a DTD in java ? or even point me in the right direction ?

Thanks in advance,
Mithil
 
A

Andrew Thompson

Mithil wrote:
...
I am new to xml, could some one please tell me how to validate xml
against a DTD ..

An XSD can check a lot more.
..in java ?

Do you run Ant? An easy way to validate XML is
to use the Ant based XMLValidate task.
..or even point me in the right direction ?

Or alternately (for a stand-alone app.) you might look
into using the same functionality (code, API's) as the
Ant task. And that seems to be..
<http://java.sun.com/webservices/jaxp/>

HTH
 
G

Greg R. Broderick

Hi all,

I am new to xml, could some one please tell me how to validate xml
against a DTD in java ? or even point me in the right direction ?

See the javadocs for javax.xml.parsers.DocumentBuilderFactory, especially the
setValidating() method.

Cheers!
GRB

--
---------------------------------------------------------------------
Greg R. Broderick (e-mail address removed)

A. Top posters.
Q. What is the most annoying thing on Usenet?
---------------------------------------------------------------------
 
M

Mithil

thanks Andrew and Greg, I will look at some of the docs and come back
to u guys if I need any more help.

Regards,

Mithil
 

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

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,044
Latest member
RonaldNen

Latest Threads

Top