You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Richard Heintze <si...@yahoo.com> on 2002/09/23 23:12:15 UTC

Schema Qs: Attributes and restrictions on xsd:patters

(1) How can I check the syntax of an attribute? I want to say <call phone="303 444 2501"> check on bn book </call>. Can an attribute be a derived simple type? What is the syntax?

(2) How do I create an element like this <phone loc="home">303 444 2501</phone>?

Here is my attempt:

Why doesn't the latest xerces-J let me put an attribute on a derivation simple type?

  <xsd:simpleType name="phone_type">
    <xsd:restriction base="xsd:string">
      <xsd:pattern value="\p{Nd}{3} \p{Nd}{3} \p{Nd}{4}( x \p{Nd}+)?"/>
    </xsd:restriction>
    <xsd:attribute name="loc" type="xsd:string" use="optional"/> 
  </xsd:simpleType>

[Error] phonelog.xsd:37:65: s4s-elt-must-match: The content of 'simpleType' must match (annotation?, (restriction | list | union)).




---------------------------------
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!