Gets or sets a value indicating whether to prohibit document type definition (DTD) processing. This property is obsolete. Use DtdProcessing instead.
Assembly: System.Xml (in System.Xml.dll)
When set to true, the XmlReader throws an XmlException when any DTD content is encountered. Do not enable DTD processing if you are concerned about Denial of Service issues or if you are dealing with untrusted sources.
If you have DTD processing enabled, you can use the XmlSecureResolver to restrict the resources that the XmlReader can access. You can also design your application so that the XML processing is memory and time constrained. For example, configure time-out limits in your ASP.NET application.
The following example validates data using a DTD.
The example uses the itemDTD.xml file as input.
<!--XML file using a DTD--> <!DOCTYPE store [ <!ELEMENT store (item)*> <!ELEMENT item (name,dept,price)> <!ATTLIST item type CDATA #REQUIRED> <!ELEMENT name (#PCDATA)> <!ELEMENT price (#PCDATA)>]> <store> <item type="supplies" ISBN="2-3631-4"> <name>paint</name> <price>16.95</price> </item> </store>
Available since 2.0