Validating XML against its DTD

I have a problem!

I am able to validate my xml file against its dtd using the Xerces DOMParser. This works fine providing the system filename in the <!Doctype declaration contains a fully qualified filename in the format "file:///c:/......". However, the xml files I will be receiving in my application will be placed in the same directory as the dtd and the doctype declaration will only specify "./jhfgjegfj.dtd". Is there a way of making the DOMParser look in the working directory of the xml file in order to find the DTD?

Thanks,

Rob.>

[578 byte] By [robfoster2000] at [2007-9-19]
# 1

See documentation of classes:

class EntityResolver

class DTDHandler

and methods:

void setEntityResolver(EntityResolver resolver);

void setDTDHandler(DTDHandler handler);

And you are done!

Kullervo

kullervokala at 2007-7-5 > top of java,Enterprise & Remote Computing,Enterprise Technologies...