Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Xml and DTD validation

Reply
Thread Tools

Xml and DTD validation

 
 
asaf.galili@gmail.com
Guest
Posts: n/a
 
      01-25-2006
Hello,
I am facing a problem, which I can't find the answer to it.
I have a xml, which I am parsing using xerces.
The problem is with the DTD validation, I want to give the DTD file
path to the parser in my code (hardcoded or using environment
parameter) and not to write the path in the xml file.
is it possible?
Thank you,
Asaf

 
Reply With Quote
 
 
 
 
George Bina
Guest
Posts: n/a
 
      01-25-2006
Hello Asaf,

If your document does not contain a reference to a DTD then you can
provide one if you register an entity resolver implementing the SAX
2.0.2 EntityResolver2 interface
http://xerces.apache.org/xerces2-j/j...Resolver2.html

If your document contains a reference to a DTD then you should be able
to get a callback in the entity resolver resolveEntity method and from
there you can return an InputSource with your desired DTD.

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

 
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
XML file from one DTD to another DTD test Java 2 07-28-2006 08:48 PM
Xml and DTD validation asaf.galili@gmail.com Java 1 01-25-2006 10:34 AM
XML DTD Validation, namespaces and best practices johnmack@gmail.com XML 1 11-02-2005 11:03 PM
How to specify DTD to DTD.getDTD for DocumentParser? Ronald Fischer Java 4 03-17-2005 09:37 AM
Removing the dtd name when using print(...) on the dtd generated class Joseph Tilian Java 0 12-21-2004 02:58 PM



Advertisments