HighTechTalks DotNet Forums  

Validating against a DTD

Dotnet XML microsoft.public.dotnet.xml


Discuss Validating against a DTD in the Dotnet XML forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
vdahiya (AT) gmail (DOT) com
 
Posts: n/a

Default Validating against a DTD - 06-09-2006 , 02:02 PM






Hello All,

I am trying to validate an xml file against a DTD. I went through a lot
of examples especially:
http://www.xmlforasp.net/codebank/util/srcview.aspx?path=../../codebank/System_Xml/XmlValidatingReader/Validator/validator.src&file=validator.cs&font=3

but its not working in my case.
First of all, when i try to add my DTD file in XmlSchemaCollection
object, it throws an error saying DocType element is expected.
I am using NITF DTD for this and there is no DocType element in it.
Any help will be appreciated.
Thanks.

VD


Reply With Quote
  #2  
Old   
Zafar Abbas
 
Posts: n/a

Default Re: Validating against a DTD - 06-19-2006 , 12:38 PM






You should not add DTDs to XmlSchemaCollection. XmlSchemaCollection only
holds XDR and XSD schemas. DTD content definitions are references through
the XML files themselves, by having a <!DOCTYPE .... definition on top of
the file.

Zafar

<vdahiya (AT) gmail (DOT) com> wrote

Quote:
Hello All,

I am trying to validate an xml file against a DTD. I went through a lot
of examples especially:

http://www.xmlforasp.net/codebank/util/srcview.aspx?path=../../codebank/System_Xml/XmlValidatingReader/Validator/validator.src&file=validator.cs&font=3

but its not working in my case.
First of all, when i try to add my DTD file in XmlSchemaCollection
object, it throws an error saying DocType element is expected.
I am using NITF DTD for this and there is no DocType element in it.
Any help will be appreciated.
Thanks.

VD




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.