The attribute match may not always contain a value , it should allow Empty String :
<template mode="on" match="">
</template>
To validate that the previous code , I'm using the following xsd Here is my xsd :
<xs:element name="template">
<xs:complexType>
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
</xs:sequence>
<xs:attribute type="xs:string" name="mode" use="optional"/>
<xs:attribute name="match" use="optional">
<xs:simpleType>
<xs:union memberTypes="xs:string emptyString"/>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:simpleType name="emptyString">
<xs:restriction base="xs:string">
<xs:length value="0"/>
</xs:restriction>
</xs:simpleType>
In the validation process against the xsd, I got the following error message :
no viable alternative at input ' <EOF> ' .
The following code doesn't show me any error.
<template mode="on" match="aaa">
</template>
Any Idea how to solve this ?