473,385 Members | 1,324 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

DTD validation without DOCTYPE in xml

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?

Thanks.
Nov 12 '05 #1
3 1543

YewMing wrote:
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?


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
http://JavaScript.FAQTs.com/
Nov 12 '05 #2
Well, I have found a way to get around with it using the method suggested in
http://lists.xml.org/archives/xml-de.../msg00485.html

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

Thanks.

"Martin Honnen" wrote:

YewMing wrote:
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?


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
http://JavaScript.FAQTs.com/

Nov 12 '05 #3
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.

"YewMing" <Ye*****@discussions.microsoft.com> wrote in message
news:82**********************************@microsof t.com...
Well, I have found a way to get around with it using the method suggested
in
http://lists.xml.org/archives/xml-de.../msg00485.html

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

Thanks.

"Martin Honnen" wrote:

YewMing wrote:
> 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?


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
http://JavaScript.FAQTs.com/

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: webbedfeet | last post by:
Hi I hope someone can help me. I have a client side form validation script which works perfectly in IE but clicking "Submit" in Mozilla does nothing - the form won't submit. Is there something I...
12
by: Marinemasters | last post by:
I used the W3C markup and validation service for http://www.wasmundbindery.com and got this reply back. I don't understand what it means or how to fix it. The DOCTYPE Declaration in your...
81
by: Michael Rozdoba | last post by:
I've been wandering around the results of numerous googles for several hours without reaching a conclusive solution, so I'm dipping a tentative toe back in ciwah... I've been persuaded here in...
2
by: J. B. Moreno | last post by:
I've got a page with an iframe in it, and a javascript that handles an onmouseover/onmouseout for it. Everything WORKS, but it doesn't validate... <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01...
16
by: J. C. Denton | last post by:
I just manually validated alexa's global top 100 sites and find only 2 sites that pass validation. They are http://www.microsoft.com/ http://www.wikipedia.org/ All others should go w3c...
9
by: rbronson1976 | last post by:
Hello all, I have a very strange situation -- I have a page that validates (using http://validator.w3.org/) as "XHTML 1.0 Strict" just fine. This page uses this DOCTYPE: <!DOCTYPE html PUBLIC...
18
by: Vlad | last post by:
I have the following code: I have a local copy of the DTD that I need to validate incoming XML documents against. The XML document has the <!DOCTYPE myname SYSTEM "myfile.dtd"> define. When the...
4
by: Wayne Wengert | last post by:
I have an XML document and a corresponding xsd document I built. I want to validate the xml document against that Schema but when I use the MSDN validator it has no place to select the xsd...
2
by: Radu | last post by:
Hi. I have been working at home on a web project (VSNET 2005 SP1). Now I have brought the project at work, and I suddenly have plenty of warnings like: Validation (XHTML 1.0 Transitional) -...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.