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 / January 2006

Tip: Looking for answers? Try searching our database.

Xml and DTD validation

Thread view: 
asaf.galili@gmail.com - 25 Jan 2006 06:50 GMT
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
George Bina - 25 Jan 2006 10:34 GMT
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/javadocs/api/org/xml/sax/ext/EntityResolver2.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


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



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