| Zafar Abbas [MSFT] 2004-08-30, 11:16 pm |
| Yes, if you want constrain the content of an attribute to a few values you
can use the xs:enumeration facet on the simple type you define for the
attribute. The following example ONLY allows stirng values "a" "b" and "c"
for the attribute "attr".
<xsd:element name="doc">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="child1" type="xsd:string"/>
<xsd:element name="child2" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="attr">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="a" />
<xsd:enumeration value="b" />
<xsd:enumeration value="c" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
"Don" <doduong12141214@hotmail.com> wrote in message
news:eBtV13ujEHA.728@TK2MSFTNGP09.phx.gbl...
> Hi:
>
> I know it is possible to specify what elements can exist under an
element.
> Is it possible to define what string values can be entered for a
particular
> attribute?
>
> Thanks,
>
> Do
>
>
|