You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Markus Isler <m_...@bluewin.ch> on 2000/12/02 00:13:43 UTC

DTD validation

Hi,

I'm using Xerces 1.2.0 with Apache 1.3.12 on Solaris 2.6. I'm using a 
DOM Parser to read XML input from a stream. I'm starting Apache as root 
and then I switch to user nobody. Now I have the problem that the DOM 
Parser tries to read the DTD file to validate the XML stream. If I place 
the DTD file in the current start-up directory witch is also the 
ServerRoot directory of Apache I get an exception:

    An exception occurred! Type:RuntimeException, 
		Message:Could not open DTD file 'test.dtd'

If I place this file in the root directory "/test.dtd" everything works 
fine. Is there any way to tell Xerces where to fetch the DTD files ?

To get ride of this problem I then tried to disable DTD validation. I set 
the validation scheme to never (or auto) validate:

    domParser.setValidationScheme(DOMParser::Val_Never);

Unfortunately the DOM Parser reads the DTD file in this case as well even 
though I thought this should not be necessary. The DOM Parser throws the
same exception:

    An exception occurred! Type:RuntimeException, 
		Message:Could not open DTD file 'test.dtd'

Why does Xerces try to open the file in this case ?

Call Stack:

	XMLPlatformUtils::openFile
	BinFileInputStream::BinFileInputStream
	LocalFileInputSource::makeStream
	ReaderMgr::createReader
	ReaderMgr::createReader
	DTDValidator::scanDocTypeDecl
	DTDValidator::scanDTD
	XMLScanner::scanProlog
	XMLScanner::scanDocument
	DOMParser::parse

I know this is no a pure Xerces related question as Apache is involved as
well. Anyway a response would be highly appreciated.

Regards

Markus