Discussion:
For security reasons DTD is prohibited in this XML document.
(too old to reply)
David Thielen
2009-01-29 17:16:22 UTC
Permalink
Hi;

One of our customers is getting the following error in our software.
This occurs in our code when we try to open and read it using the .NET
XML classes.

For security reasons DTD is prohibited in this XML document. To enable
DTD processing set the ProhibitD...

(Sorry, the rest of the rrror message is cut off in the screen shot
they sent us.)

What's going on here and what do we do to make this work?

thanks - dave

***@at-at-***@windward.dot.dot.net
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
Martin Honnen
2009-01-29 18:03:01 UTC
Permalink
Post by David Thielen
One of our customers is getting the following error in our software.
This occurs in our code when we try to open and read it using the .NET
XML classes.
For security reasons DTD is prohibited in this XML document. To enable
DTD processing set the ProhibitD...
XmlReaderSettings settings = new XmlReaderSettings();
settings.ProhibitDtd = false;
using (XmlReader reader = XmlReader.Create("file.xml", settings))
{
...
}
see
http://msdn.microsoft.com/en-us/library/system.xml.xmlreadersettings.prohibitdtd.aspx
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
David Thielen
2009-01-30 17:25:24 UTC
Permalink
Got it - thanks
Post by Martin Honnen
Post by David Thielen
One of our customers is getting the following error in our software.
This occurs in our code when we try to open and read it using the .NET
XML classes.
For security reasons DTD is prohibited in this XML document. To enable
DTD processing set the ProhibitD...
XmlReaderSettings settings = new XmlReaderSettings();
settings.ProhibitDtd = false;
using (XmlReader reader = XmlReader.Create("file.xml", settings))
{
...
}
see
http://msdn.microsoft.com/en-us/library/system.xml.xmlreadersettings.prohibitdtd.aspx
***@at-at-***@windward.dot.dot.net
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
sandile ngubeni
2011-07-26 11:39:41 UTC
Permalink
How did you get it, where. Please share
Post by David Thielen
Hi;
One of our customers is getting the following error in our software.
This occurs in our code when we try to open and read it using the .NET
XML classes.
For security reasons DTD is prohibited in this XML document. To enable
DTD processing set the ProhibitD...
(Sorry, the rest of the rrror message is cut off in the screen shot
they sent us.)
What's going on here and what do we do to make this work?
thanks - dave
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com
Cubicle Wars - http://www.windwardreports.com/film.htm
Post by Martin Honnen
XmlReaderSettings settings = new XmlReaderSettings();
settings.ProhibitDtd = false;
using (XmlReader reader = XmlReader.Create("file.xml", settings))
{
...
}
see
http://msdn.microsoft.com/en-us/library/system.xml.xmlreadersettings.prohibitdtd.aspx
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Post by Steven Cheng
Hi Dave,
Based on the error message itself, it indicate that the XML document you're
-=====================
<!DOCTYPE NEWSPAPER [
<!ELEMENT NEWSPAPER (ARTICLE+)>
<!ELEMENT ARTICLE (HEADLINE, BYLINE, LEAD, BODY, NOTES)>
........................
]>
======================
And for .NET 2.0 based XML processing(via Reader/Writer), we use
XmlReader/Writer abstract class to create the certain Reader/Writer
implemetation class. e.g.
============
XmlReaderSettings settings = new XmlReaderSettings();
XmlReader reader = XmlReader.Create("books.xml", settings);
============
http://msdn.microsoft.com/en-us/library/9khb6435.aspx
However, by default, the "XmlReaderSettings.ProhibitDtd" property is
"true", which means any DTD in XML document(loaded by reader created via
this setting) is not allowed.
As Martin suggested, you can turn off this property in the xmlReaderSetting
http://msdn.microsoft.com/en-us/library/system.xml.xmlreadersettings.aspx
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Post by David Thielen
Got it - thanks
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com
Cubicle Wars - http://www.windwardreports.com/film.htm
Steven Cheng
2009-01-30 02:52:04 UTC
Permalink
Hi Dave,

Based on the error message itself, it indicate that the XML document you're
processing include some DTD declaration such as:

-=====================
<!DOCTYPE NEWSPAPER [

<!ELEMENT NEWSPAPER (ARTICLE+)>
<!ELEMENT ARTICLE (HEADLINE, BYLINE, LEAD, BODY, NOTES)>
........................

]>
======================

And for .NET 2.0 based XML processing(via Reader/Writer), we use
XmlReader/Writer abstract class to create the certain Reader/Writer
implemetation class. e.g.

============
XmlReaderSettings settings = new XmlReaderSettings();
XmlReader reader = XmlReader.Create("books.xml", settings);
============

#Creating XML Readers
http://msdn.microsoft.com/en-us/library/9khb6435.aspx

However, by default, the "XmlReaderSettings.ProhibitDtd" property is
"true", which means any DTD in XML document(loaded by reader created via
this setting) is not allowed.

As Martin suggested, you can turn off this property in the xmlReaderSetting
to create the XmlReader that can parse DTD awared XML document:

#XmlReaderSettings Class
http://msdn.microsoft.com/en-us/library/system.xml.xmlreadersettings.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
***@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
Subject: For security reasons DTD is prohibited in this XML document.
Date: Thu, 29 Jan 2009 10:16:22 -0700
Hi;
One of our customers is getting the following error in our software.
This occurs in our code when we try to open and read it using the .NET
XML classes.
For security reasons DTD is prohibited in this XML document. To enable
DTD processing set the ProhibitD...
(Sorry, the rest of the rrror message is cut off in the screen shot
they sent us.)
What's going on here and what do we do to make this work?
thanks - dave
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com
Cubicle Wars - http://www.windwardreports.com/film.htm
Loading...