470,855 Members | 1,303 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,855 developers. It's quick & easy.

ValidationType.Auto and reading schema attribute

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

Jun 20 '06 #1
3 1411
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" <jo****@gmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.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

Jun 21 '06 #2
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" <jo****@gmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.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


Jun 21 '06 #3
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" <jo****@gmail.com> wrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
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" <jo****@gmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.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
>

Jun 21 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Dave Mc | last post: by
4 posts views Thread by Gordon Dickens | last post: by
reply views Thread by chris.millar | last post: by
reply views Thread by Derek | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.