<%@ page language="C#" masterpagefile="~/templates/Master1.master" inherits="Page" keywords="Using DTDs in Microsoft .NET,MSXML 3,MSXML 4,MSXML 6,MSXML 4.0,MSXML 6.0,download MSXML,System.Xml"%>

Using DTDs in Microsoft .NET

<%= ConfigurationManager.AppSettings["SS"] %> includes the ability to access the DTD parsing technology that Microsoft has implemented and distributed over the years. For example, to validate XML documents against DTDs, the following are included:

DTD Parsing with .Net

Both the Microsoft MSXML family of DLLs and the Microsoft .Net architecture support DTD parsing and validation. For example, to read a file while enabling DTD usage, the following .Net code fragments might be helpful:

DTD Parsing with Visual Basic

Dim settings As New XmlReaderSettings()
settings.ValidationType = ValidationType.DTD ' turn DTD Validation on
Dim reader As XmlReader = XmlReader.Create("book.xml", settings)

DTD Parsing with C#

XmlReaderSettings settings = new XmlReaderSettings();
settings.ValidationType = ValidationType.DTD; // turn DTD Validation on
XmlReader reader = XmlReader.Create("book.xml", settings);

Where to get the Parsers

If, for some reason, you machine is lacking one or more of these (which is unlikely, since they are usually part of some larger installation package or Microsoft update, but still happens sometimes), here are some pointers to the downloads from Microsoft:

Where to get <%= ConfigurationManager.AppSettings["SS"] %>

Get your red-hot copy of <%= ConfigurationManager.AppSettings["SS"] %> and begin designing and working with DTDs, and your parsers will have something to parse!

Try Stylus DTD Generator

Generate DTDs with our award-winning DTD conversion and DTD generation utilities - Download a free trial!

Related Features