N
nicolaspujol
Hi, wondering if anybody could help me figure how to. in schema,
restrict the list of tokens I may have as an attribute value. For
example
<xs:complexType name="customer">
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
</xs:sequence>
<xs:attribute name="life" use="optional">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="session"/>
<xs:enumeration value="request"/>
<xs:enumeration value="context"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
I would like "Norwegian_customer" to extend from customer but to allow
for the "life" attribute only the "session" value. This is what I am
doing so far but is not correct.
<xs:complexType name="Norwegian_customer">
<xs:complexContent>
<xs:restriction base="pf:customer">
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
</xs:sequence>
<xs:attribute name="life" use="optional">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="session"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
Thanks in advance
restrict the list of tokens I may have as an attribute value. For
example
<xs:complexType name="customer">
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
</xs:sequence>
<xs:attribute name="life" use="optional">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="session"/>
<xs:enumeration value="request"/>
<xs:enumeration value="context"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
I would like "Norwegian_customer" to extend from customer but to allow
for the "life" attribute only the "session" value. This is what I am
doing so far but is not correct.
<xs:complexType name="Norwegian_customer">
<xs:complexContent>
<xs:restriction base="pf:customer">
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
</xs:sequence>
<xs:attribute name="life" use="optional">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="session"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
Thanks in advance