-<root>
+<?xml version="1.0" encoding="utf-8"?>
+<root>
<!--
Microsoft ResX Schema
<data name="Sch_TotalDigitsMismatch" xml:space="preserve">
<value>It is an error if the derived 'totalDigits' facet value is greater than the parent 'totalDigits' facet value.</value>
</data>
+ <data name="Sch_FractionDigitsMismatch" xml:space="preserve">
+ <value>It is an error if the derived 'fractionDigits' facet value is greater than the parent 'fractionDigits' facet value.</value>
+ </data>
<data name="Sch_FacetBaseFixed" xml:space="preserve">
<value>Values that are declared as {fixed} in a base type can not be changed in a derived type.</value>
</data>
<data name="CompilingScriptsNotSupported" xml:space="preserve">
<value>Compiling JScript/CSharp scripts is not supported</value>
</data>
-</root>
\ No newline at end of file
+</root>
{
if (_derivedRestriction.FractionDigits > _datatype.Restriction.FractionDigits)
{
- throw new XmlSchemaException(SR.Sch_TotalDigitsMismatch, string.Empty);
+ throw new XmlSchemaException(SR.Sch_FractionDigitsMismatch, string.Empty);
}
}
SetFlag(facet, RestrictionFlags.FractionDigits);
Assert.Equal(0, errorCount);
}
}
+
+ [Fact]
+ public void FractionDigitsMismatch_Throws()
+ {
+ string schema = @"<?xml version='1.0' encoding='utf-8' ?>
+<xs:schema elementFormDefault='qualified'
+ xmlns:xs='http://www.w3.org/2001/XMLSchema'>
+ <xs:simpleType name='foo'>
+ <xs:restriction base='xs:decimal'>
+ <xs:fractionDigits value='8' fixed='true'/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name='bar'>
+ <xs:restriction base='foo'>
+ <xs:fractionDigits value='9'/>
+ </xs:restriction>
+ </xs:simpleType>
+</xs:schema>
+";
+
+ XmlSchemaSet ss = new XmlSchemaSet();
+ ss.Add(null, XmlReader.Create(new StringReader(schema)));
+
+ Exception ex = Assert.Throws<XmlSchemaException>(() => ss.Compile());
+ Assert.Contains("fractionDigits", ex.Message);
+ Assert.DoesNotContain("totalDigits", ex.Message);
+ }
}
}