There is a problem with schema validation of xs:anyURI data type in System.Xml.XmlValidatingReader.
The schema spec and especially RFC 2396 state that xs:anyURI instance can be empty, but System.Xml.XmlValidatingReader keeps failing on such an instance.
To reproduce the error use the following schema:
<?xml version="1.0" encoding="UTF-8"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="AnyURI" type="xs:anyURI"> </xs:element></xs:schema>
And this instance document:
<?xml version="1.0" encoding="UTF-8"?><AnyURI/>
There is currently no workaround for .NET FX 1.0/1.1. Actually Whidbey is the only patch that fixes this. :)
The problem is even more troublesome when one does not have direct control over instance document syntax/serialization. For example in case of auto generated XML by Microsoft Office InfoPath during digital signature insertion. Attribute /Signature/SignedInfo/Reference/@URI is (according to XML Signature schema) typed as xs:anyURI.
Validation problem therefore manifests itself as inability to validate any digitally signed InfoPath documents.
Remember Me
The opinions expressed herein are my own personal opinions and do not represent my company's view in any way.
My views often change.
This blog is just a collection of bytes.
Copyright © 2003-2024Matevž Gačnik
E-mail