Hi

I have a task that takes in various types of XML messages and evaluates XPath expressions.  Im now using input messages that have been produced with a DTD and start with the following:

<?xml version="1.0"?>
<!DOCTYPE MxML SYSTEM "test.dtd">

When I try and parse the message I get the following error:

Fatal Error.Occurred at file SourceXML , line 2 , column 34. An exception occurred! Type:RuntimeException, Message:Could not open DTD file 'test.dtd'

Im using the following code to parse the message:

XalanSourceTreeDOMSupport theDOMSupport;
XalanSourceTreeParserLiaison theLiaison(theDOMSupport);
         
theDOMSupport.setParserLiaison(&theLiaison);
         
XalanDocument* const theDocument = theLiaison.parseXMLStream(theInputSource);


Ive tried housing the test.dtd in the directory where the executable is run, but have had no joy.  If I change the input msg to use the full path to the dtd it works OK - however that is not really an option as the message will be coming from an external source.  

I could extract that component of the message before parsing, but would prefer to preserve the msg in it's entirety.  Is there anyway to switch off the parsing of the dtd?

Im using Xalan Version: 1.9 & Xerces Version: 1.6.

Any help is much appreciated.

Cheers
Chris

Reply via email to