HighTechTalks DotNet Forums  

ValidationType.Auto and reading schema attribute

Dotnet XML microsoft.public.dotnet.xml


Discuss ValidationType.Auto and reading schema attribute in the Dotnet XML forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
jhowey
 
Posts: n/a

Default ValidationType.Auto and reading schema attribute - 06-20-2006 , 06:22 PM






Hi,

I would like my default ValidationType to be Auto.

Now let's say I have both a DTD and an XSD file for this XML file being
validated. While it's ValidationType.Auto, it will validate the DTD,
but will not even attempt to read/validate the namespace or even check
if schema file exists.

I suppose it's a resolver problem; anyone have any insight on how I can
have it check the schema File while Auto (without setting
ValidationType.Schema)?

..NET 1.1


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

Default Re: ValidationType.Auto and reading schema attribute - 06-20-2006 , 07:56 PM






Validation can not perform DTD and XSD validation at the same time. If you
have ValidationType set to Auto, and have a DTD declaraion, you will only
get DTD validation. It will not look for the XSD schema file.

Zafar

"jhowey" <jonath (AT) gmail (DOT) com> wrote

Quote:
Hi,

I would like my default ValidationType to be Auto.

Now let's say I have both a DTD and an XSD file for this XML file being
validated. While it's ValidationType.Auto, it will validate the DTD,
but will not even attempt to read/validate the namespace or even check
if schema file exists.

I suppose it's a resolver problem; anyone have any insight on how I can
have it check the schema File while Auto (without setting
ValidationType.Schema)?

.NET 1.1




Reply With Quote
  #3  
Old   
jhowey
 
Posts: n/a

Default Re: ValidationType.Auto and reading schema attribute - 06-20-2006 , 10:37 PM



Is there a way i can override the class so I can reverse it (ie; look
for Schema first)?

Zafar Abbas wrote:
Quote:
Validation can not perform DTD and XSD validation at the same time. If you
have ValidationType set to Auto, and have a DTD declaraion, you will only
get DTD validation. It will not look for the XSD schema file.

Zafar

"jhowey" <jonath (AT) gmail (DOT) com> wrote in message
news:1150845723.565339.256500 (AT) i40g2000cwc (DOT) googlegroups.com...
Hi,

I would like my default ValidationType to be Auto.

Now let's say I have both a DTD and an XSD file for this XML file being
validated. While it's ValidationType.Auto, it will validate the DTD,
but will not even attempt to read/validate the namespace or even check
if schema file exists.

I suppose it's a resolver problem; anyone have any insight on how I can
have it check the schema File while Auto (without setting
ValidationType.Schema)?

.NET 1.1



Reply With Quote
  #4  
Old   
Priya Lakshminarayanan
 
Posts: n/a

Default Re: ValidationType.Auto and reading schema attribute - 06-21-2006 , 01:13 PM



In .NET 2.0, You can chain multiple readers and hence wrap a dtd validating
reader with a schema validating reader to get the same file to pass through
DTD/Schema validation at the same time.
XmlReaderSettings settings = new XmlReaderSettings();
settings.ValidationType = ValidationType.DTD;
XmlReader dtdValidatingReader = XmlReader.Create(xmlFile, settings);

settings.ValidationType = ValidationType.Schema;
XmlReader xsdValidatingReader = XmlReader.Create(dtdValidatingReader,
settings);
while(xsdValidatingReader.Read()) { }

Thanks,
Priya

"jhowey" <jonath (AT) gmail (DOT) com> wrote

Quote:
Is there a way i can override the class so I can reverse it (ie; look
for Schema first)?

Zafar Abbas wrote:
Validation can not perform DTD and XSD validation at the same time. If
you
have ValidationType set to Auto, and have a DTD declaraion, you will only
get DTD validation. It will not look for the XSD schema file.

Zafar

"jhowey" <jonath (AT) gmail (DOT) com> wrote in message
news:1150845723.565339.256500 (AT) i40g2000cwc (DOT) googlegroups.com...
Hi,

I would like my default ValidationType to be Auto.

Now let's say I have both a DTD and an XSD file for this XML file being
validated. While it's ValidationType.Auto, it will validate the DTD,
but will not even attempt to read/validate the namespace or even check
if schema file exists.

I suppose it's a resolver problem; anyone have any insight on how I can
have it check the schema File while Auto (without setting
ValidationType.Schema)?

.NET 1.1





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.