Serious bug in System.Xml.XmlValidatingReader 

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.

Categories:  XML
Monday, March 08, 2004 6:31:39 PM (Central Europe Standard Time, UTC+01:00)  #    Comments