We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The validator reports an error for the following style definition:
<x:fill> <x:gradientFill type="linear" degree="90"> <x:stop position="0"> <x:color theme="0" /> </x:stop> <x:stop position="1"> <x:color theme="4" /> </x:stop> <x:stop position="2"> <x:color rgb="00FF0000" /> </x:stop> </x:gradientFill> </x:fill>
I can't find the matching constraint. This is specification for a gradientFill:
<xsd:complexType name="CT_GradientFill"> <xsd:sequence> <xsd:element name="stop" type="CT_GradientStop" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> <xsd:attribute name="type" type="ST_GradientType" use="optional" default="linear"/> <xsd:attribute name="degree" type="xsd:double" use="optional" default="0"/> <xsd:attribute name="left" type="xsd:double" use="optional" default="0"/> <xsd:attribute name="right" type="xsd:double" use="optional" default="0"/> <xsd:attribute name="top" type="xsd:double" use="optional" default="0"/> <xsd:attribute name="bottom" type="xsd:double" use="optional" default="0"/> </xsd:complexType> <xsd:complexType name="CT_GradientStop"> <xsd:sequence> <xsd:element name="color" type="CT_Color" minOccurs="1" maxOccurs="1"/> </xsd:sequence> <xsd:attribute name="position" type="xsd:double" use="required"/> </xsd:complexType>
If I understand this correctly then there can be an unlimited number of stops. Any limits could be imposed using the maxOccurs attribute of the fill.
The text was updated successfully, but these errors were encountered:
@tomjebo Can you take a look at this?
Sorry, something went wrong.
Here's a repro:
var xml = @" <x:fill xmlns:x=""http://schemas.openxmlformats.org/spreadsheetml/2006/main""> <x:gradientFill type=""linear"" degree=""90""> <x:stop position=""0""> <x:color theme=""0"" /> </x:stop> <x:stop position=""1""> <x:color theme=""4"" /> </x:stop> <x:stop position=""2""> <x:color rgb=""00FF0000"" /> </x:stop> </x:gradientFill> </x:fill>"; var fill = new Fill(xml); var validator = new OpenXmlValidator(); var results = validator.Validate(fill); Assert.Empty(results);
I get the following error:
Description="The attribute 'position' has invalid value '2'. The MaxInclusive constraint failed. The value must be less than or equal to 1."
The semantic validation (not in the schema) constrains the value of position between 0 and 1.
position
0
1
No branches or pull requests
The validator reports an error for the following style definition:
I can't find the matching constraint. This is specification for a gradientFill:
If I understand this correctly then there can be an unlimited number of stops. Any limits could be imposed using the maxOccurs attribute of the fill.
The text was updated successfully, but these errors were encountered: