Bug 12469 - Processing of atomic datatypes in XML schema not working
Summary: Processing of atomic datatypes in XML schema not working
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.XML ()
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-05-30 06:06 UTC by dev
Modified: 2013-08-07 05:57 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description dev 2013-05-30 06:06:51 UTC
Description of the problem:

  Using a compiled XmlSchemaSet with a reference to an 
  atomic data type like unsignedInt, duration, gYear, hexBinary,
  anyURI, ..., leads to an exception when validating a XmlDocument:

  "XmlSchema error: Failed to convert attribute value to type http://www.w3.org/2001/XMLSchema:unsignedInt"

  The bug seem to appear in all versions after v2.6.7.

Namespaces involved:

  - System.Xml
  - System.Xml.Schema

Steps to reproduce the bug:

  http://github.com/mastersign/mono-xml-schema-bug/blob/master/Program.cs

  in short:

  1. loading a schema like the following (trigger is usage of 'xs:anyURI'):

   <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' elementFormDefault='qualified'>
     <xs:element name='EL'>
       <xs:complexType>
         <xs:attribute name='attr' type='xs:anyURI' use='required' />
       </xs:complexType>
     </xs:element>
   </xs:schema>

  in a XmlSchemaSet (XmlSchemaSet.Add(XmlSchema.Read(...)), XmlSchemaSet.Compile())

  2. loading a XML document like the following:

   <EL attr='http://www.server.net' />

  as XmlDocument (doc = new XmlDocument(); doc.Load(...)):

  3. validate the document with the loaded schema (doc.Schemas = schemaSet, doc.Validate(...))

Expected result:

  - successful validation

Actual result:

  http://github.com/mastersign/mono-xml-schema-bug/blob/master/results.txt

  - XmlValidationException: "XmlSchema error: Failed to convert ..."
Comment 1 Atsushi Eno 2013-08-07 05:57:28 UTC
Fixed in master [72d14cc].

There seems still issue on rejecting invalid inputs, but that's different issue.