Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validating an XML Doc which does not specify a DTD

Status
Not open for further replies.

ivpotter

Programmer
Jan 19, 2001
13
0
0
GB
Is it possible to validate an XML document when that XML document does not
specify a DTD via a <!DOCTYPE ...> section?

What I would like to do is create the factory - reference a DTD from
within the code then parse and manipulate an XML document by importing
fragments from a series of files prior to writing it out again, confident
that it is still valid as well as well-formed.

I am using a Xerces parser via Java.

Thanks for your help.

Ivor

 
Hi,

Did u ever get any help with this as I am having the same issue.

Thanks.
 
No, unfortunately I never resolved this and had to make do with checking for well-formedness only.

Ivor
 
Look into

org.apache.xerces.parsers.SAXParser

I use this class to validate an XML file against an XSD file, but I would think you could specify a DTD file instead.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top