Groups | Blog | Home
all groups > dotnet xml > july 2005 >

dotnet xml : DTD validation without DOCTYPE in xml



Martin Honnen
7/7/2005 12:00:00 AM

[quoted text, click to view]

No, I don't think so, but it is possible to use XSLT or other tools to
make a copy of the incoming XML where the DOCTYPE declaration is added
and then you can do validation on the copy.


--

Martin Honnen --- MVP XML
YewMing
7/7/2005 2:55:02 AM
Hi,
I have some XML files that needs to be validated with a DTD but the xml
files does not have the DOCTYPE tag that reference to the dtd file. Is there
any way to tell XmlValidatingReader to specifically use that DTD file even
when DOCTYPE is not in the xml file?

YewMing
7/7/2005 11:58:04 PM
Well, I have found a way to get around with it using the method suggested in
http://lists.xml.org/archives/xml-dev/200202/msg00485.html

I hope .NET will implement something similar to SAX2's
org.xml.sax.ext.EntityResolver2.getExternalSubset method

Thanks.

[quoted text, click to view]
Chris Lovett
7/8/2005 12:40:11 AM
In the meantime, you could always convert your DTD to a XML schema and
provide the schemas to the XmlValidatingReader and it will validate the XML
based on that. Thereis a dtd2xsd tool on www.gotdotnet.com.

[quoted text, click to view]

AddThis Social Bookmark Button