Xml and DTD validation

Discussion in 'XML' started by asaf.galili@gmail.com, Jan 25, 2006.

  1. Guest

    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
     
    , Jan 25, 2006
    #1
    1. Advertising

  2. George Bina Guest

    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
     
    George Bina, Jan 25, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joseph Tilian
    Replies:
    0
    Views:
    379
    Joseph Tilian
    Dec 21, 2004
  2. Ronald Fischer
    Replies:
    4
    Views:
    1,806
    Ronald Fischer
    Mar 17, 2005
  3. Replies:
    1
    Views:
    318
    George Bina
    Jan 25, 2006
  4. Replies:
    1
    Views:
    766
    Richard Tobin
    Nov 2, 2005
  5. test
    Replies:
    2
    Views:
    2,179
    Oliver Wong
    Jul 28, 2006
Loading...

Share This Page