Using an XML for beginners book, I can't get an XML file and XSD schema copied directly from the book to validate, and its bugging the hell out of me. Here are the key parts of the code the Validator (... keeps showing to be in error:
XML:
<painting paintingID="123-4567-890">
XSD:
(...missing code...)
<xsd:attribute name="paintingID" type="catalogID" />
(...missing code...)
<xsd:simpleType name="catalogID">
<xsd:restriction base="xsd:string">
<xsdattern value="\d{3}-\d{4}-\d{3}" />
</xsd:restriction>
</xsd:simpleType>
Error Messages:
cvc-attribute.3: The value '123-4567-890' of attribute 'paintingID' on element 'painting' is not valid with respect to its type, 'catalogID'.
cvc-pattern-valid: Value '123-4567-890' is not facet-valid with respect to pattern '\\d{3}\\-\\d{4}\\-\\d{3}' for type 'catalogID'.
Being new to this, I'm sure I'm missing something simple, but I've checked and rechecked the XML and XSD codes multiple times against what's in the book and it's exactly the same. Any thoughts?
XML:
<painting paintingID="123-4567-890">
XSD:
(...missing code...)
<xsd:attribute name="paintingID" type="catalogID" />
(...missing code...)
<xsd:simpleType name="catalogID">
<xsd:restriction base="xsd:string">
<xsdattern value="\d{3}-\d{4}-\d{3}" />
</xsd:restriction>
</xsd:simpleType>
Error Messages:
cvc-attribute.3: The value '123-4567-890' of attribute 'paintingID' on element 'painting' is not valid with respect to its type, 'catalogID'.
cvc-pattern-valid: Value '123-4567-890' is not facet-valid with respect to pattern '\\d{3}\\-\\d{4}\\-\\d{3}' for type 'catalogID'.
Being new to this, I'm sure I'm missing something simple, but I've checked and rechecked the XML and XSD codes multiple times against what's in the book and it's exactly the same. Any thoughts?