all groups > dotnet xml > may 2005 >
You're in the

dotnet xml

group:

Access to DTD


Access to DTD Jinsong Liu
5/26/2005 12:00:00 AM
dotnet xml:
Hello Group:

Sorry for double post. I posted this question on the XML group. Then
realized this is the group where the question should be posted, since
I am using .NET.

I have an object model representing a XML document. At the end of the
process, a XML document will be generated based on the data hold by
the object model. I can validate the XML (when it is being generate)
against a DTD. Is that possible I can get access to the DTD and
validate object property values before the XML document get generate?

Thanks

JSL
Re: Access to DTD Martin Honnen
5/27/2005 12:00:00 AM

[quoted text, click to view]

I am not sure I understand what you want to do but .NET does not expose
any object model for DTDs as public APIs.

--

Martin Honnen --- MVP XML
Re: Access to DTD Chris Lovett
6/6/2005 11:54:39 PM
There is a new validator in .NET 2.0 called XmlSchemaValidator that takes an
XmlSchemaSet and then you can walk your object model calling methods like
ValidateElement and ValidateAttribute and so on and it will tell you about
any problems. To convert your DTD to XSD so you can add it to the
XmlSchemaSet you can use the Create Schema command in the XML editor in
Visual Studio 2005 or you can use the DTD2XSD tool on
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=54358B80-1324-49E9-821B-A08911356AD7.

Enjoy!

[quoted text, click to view]

AddThis Social Bookmark Button