In my schema file I am trying to set a pattern rule for an attribute <doc number="00-1234"> in my xml file. The code I have used is in the schema is:
.....
<xsd:complexType name="docType">
<xsd:sequence>
<xsd:element name="title" type="xsd:string" minOccurs="1" maxOccurs="1"/> ..... </xsd:element> <xsd:attribute name="number" type="numberType" use="required"/> </xsd:complexType>
<xsd:simpleType name="numberType">
<xsd:restriction base="xsd:string">
<xsd
attern value="([0-9]){2}-([0-9]){4}"/>
</xsd:restriction>
</xsd:simpleType>
The pattern is correct, but when I validate my xml file against this using Xerces, I get the following error:
"List | Union | Restriction content is invalid for type numberType"
What do I need to do to sort out this problem?
Thanks
Vicky
.....
<xsd:complexType name="docType">
<xsd:sequence>
<xsd:element name="title" type="xsd:string" minOccurs="1" maxOccurs="1"/> ..... </xsd:element> <xsd:attribute name="number" type="numberType" use="required"/> </xsd:complexType>
<xsd:simpleType name="numberType">
<xsd:restriction base="xsd:string">
<xsd
</xsd:restriction>
</xsd:simpleType>
The pattern is correct, but when I validate my xml file against this using Xerces, I get the following error:
"List | Union | Restriction content is invalid for type numberType"
What do I need to do to sort out this problem?
Thanks
Vicky