reference to a DTD that resides in a jar file

Discussion in 'XML' started by avishosh, Aug 9, 2004.

  1. avishosh

    avishosh Guest

    Hi,

    I have a java program that reads it's settings from an .xml config
    file with a refernce to a .dtd file but I want to store the .dtd in
    the .jar file with the rest of the programs resources.
    Anyone know how I'd write a doctype tag for this?
    The .jar could be moved around on the server as could the .dtd so I
    don't want to write an absolute path in the doctype declaration.
    avishosh, Aug 9, 2004
    #1
    1. Advertising

  2. avishosh wrote:


    > I have a java program that reads it's settings from an .xml config
    > file with a refernce to a .dtd file but I want to store the .dtd in
    > the .jar file with the rest of the programs resources.
    > Anyone know how I'd write a doctype tag for this?
    > The .jar could be moved around on the server as could the .dtd so I
    > don't want to write an absolute path in the doctype declaration.


    What are you using to parse? If you are using SAX then maybe it is
    possible to implement your own org.xml.sax.EntityResolver, at least its
    documentation says

    If a SAX application needs to implement customized handling for external
    entities, it must implement this interface and register an instance with
    the SAX driver using the setEntityResolver method.

    The XML reader will then allow the application to intercept any external
    entities (including the external DTD subset and external parameter
    entities, if any) before including them.


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Aug 9, 2004
    #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. CES
    Replies:
    1
    Views:
    450
    Alvin Bruney
    Oct 2, 2003
  2. JML
    Replies:
    3
    Views:
    1,257
    Andrew Thompson
    Oct 26, 2004
  3. Arnold Peters
    Replies:
    0
    Views:
    567
    Arnold Peters
    Jan 5, 2005
  4. muttley
    Replies:
    0
    Views:
    2,718
    muttley
    Oct 20, 2005
  5. cyberco
    Replies:
    4
    Views:
    3,754
    Roedy Green
    Feb 14, 2006
Loading...

Share This Page