TonyPG Posted March 30, 2012 Share Posted March 30, 2012 Hi i am having problems with adding a simpleType regex pattern. I have this in my code at the moment. <xsd:simpleType name="SKU"> <xsd:restriction base="xsd:string"> <xsd:pattern value="^[^0-9][a-zA-z0-9]*" /> </xsd:restriction></xsd:simpleType> <xsd:element name="commercial-listing">...<xsd:attribute name="version" type="SKU"></xsd:attribute>... There is no error message in the schema document. Dotted line indicated unrelated code. Then in the XML doc <commercial-listing version="A1234">......</commercial-listing> But no matter what pattern i use even if it is a single character both in the pattern and in the xml doc. The version ENTITY underlines red in Eclipse and i get an error. Description Resource Path Location Typecvc-attribute.3: The value 'A1234' of attribute 'version' on element 'commercial-listing' is not valid with respect to its type, 'SKU'. reml.xml /src line 10 XML Problemcvc-pattern-valid: Value 'A1234' is not facet-valid with respect to pattern '^[^0-9][a-zA-z0-9]*' for type 'SKU'. reml.xml /src line 10 XML Problem Any advice would be appreciated. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.