[Mono-bugs] [Bug 433774] Xml schema validation throws a XmlSchemaValidationException exception because of a fixed value
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Mon Oct 27 18:35:43 EDT 2008
https://bugzilla.novell.com/show_bug.cgi?id=433774
User atsushi at ximian.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=433774#c1
--- Comment #1 from Atsushi Enomoto <atsushi at ximian.com> 2008-10-27 16:35:42 MDT ---
much simplified version:
---- 433774.cs
using System;
using System.Xml;
using System.Xml.Schema;
public class Test
{
public static void Main ()
{
XmlDocument doc = new XmlDocument();
doc.LoadXml("<Root version='3' xmlns='urn:foo'/>");
XmlSchemaSet schemaSet = new XmlSchemaSet();
schemaSet.Add(XmlSchema.Read(XmlReader.Create("433774.xsd"), null));
doc.Schemas = schemaSet;
XmlNode root = doc.DocumentElement;
doc.Validate(null, root);
}
}
---- 433774.xsd
<xs:schema targetNamespace="urn:foo" xmlns="urn:foo"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Root">
<xs:complexType>
<xs:sequence>
</xs:sequence>
<xs:attribute name="version" type="xs:string" fixed="3" />
</xs:complexType>
</xs:element>
</xs:schema>
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the mono-bugs
mailing list