W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2001

How do I validate XML with a DTD using DOM parser

From: Sindhu O K <SindhuOK@infy.com>
Date: Wed, 1 Aug 2001 14:06:27 +0530
Message-ID: <FA13E89D0804CB4DB5FB420B70E2C0CC4304FD@kecmsg07.ad.infosys.com>
To: <www-dom@w3.org>
Hi,
	I have a problem in validating XML with DTD while parsing with
DOM parser. I tried to use the setValidation() method. Since it is
protected I couldn't use it. Then I tried the same with setFeature()
mthod. But this doesn't semm to be working. Here is the code that  have
written
		formParser = new DOMParser();
 
formParser.setFeature("http://xml.org/sax/features/validation",true);
            
            fReader = new FileReader(strFilePath);
            //Create an input source to parse
            iSource = new InputSource(fReader);

            formParser.parse(iSource);

Any pointers to solve this?
Thanks in advance
Sindhu
Received on Wednesday, 1 August 2001 04:39:24 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:49 GMT