Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Validating using external DTD

Reply
Thread Tools

Validating using external DTD

 
 
Anand
Guest
Posts: n/a
 
      02-10-2004
Hi all,
I have an XML which comes through a HTTP request. I want to
validate that
XML with a DTD in the local machine. That XML does not have a DOCTYPE
element by itself. Can someone tell me how this can be accomplished
using
xerces java.

I had tried the sample "XMLGrammarBuilder.java" which comes with the
xerces
package. But this one seems to validate the XML only if it had the
DOCTYPE
element referencing the DTD. If I removed the DOCTYPE from the XML and
ran
the program, it gives an error such as "[Error] test.xml:2:12:
cvc-elt.1: Cannot find the declaration of element
'<the_root_element>'". But the XML is valid.

If someone has a sample, it would be of great help if you can share it
with
me.

Thanks,
Anand
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validating XML with an external DTD salimk786 Java 8 08-04-2007 12:01 PM
Removing the dtd name when using print(...) on the dtd generated class Joseph Tilian Java 0 12-21-2004 02:58 PM
Validating XML against a DTD that is not supplied in the XML Schema Ben Jessel Java 0 08-05-2004 11:45 AM
Validating a DOM against a DTD? Stefan Ram Java 0 07-25-2004 05:14 PM
parsing XML to DOM, validating against a local DTD, using Xerces under JAXP? bugbear XML 0 08-28-2003 09:22 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57