Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2007

Tip: Looking for answers? Try searching our database.

validate xml with a dtd in java

Thread view: 
Mithil - 18 Jul 2007 01:15 GMT
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
Andrew Thompson - 18 Jul 2007 02:14 GMT
...
>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.
<http://ant.apache.org/manual/OptionalTasks/xmlvalidate.html>

>..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

Signature

Andrew Thompson
http://www.athompson.info/andrew/

Greg R. Broderick - 18 Jul 2007 07:18 GMT
Mithil <mithil.mohan@gmail.com> wrote in news:1184717717.891512.153280
@o11g2000prd.googlegroups.com:

> 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

Signature

---------------------------------------------------------------------
Greg R. Broderick                  usenet200707@blackholio.dyndns.org

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

Mithil - 23 Jul 2007 18:52 GMT
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
Roedy Green - 23 Jul 2007 20:17 GMT
>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 http://mindprod.com/jgloss/xml.html
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.