Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Restrictions on attributes

Status
Not open for further replies.

RwDwR

Programmer
Aug 1, 2002
16
NL
I want to achieve the following:
Code:
<xs:attribute name=&quot;Unit&quot; >
	<xs:restriction base=&quot;xs:string&quot;>
		<xs:enumeration value=&quot;Degree&quot;/>
		<xs:enumeration value=&quot;Inch&quot;/>
	</xs:restriction>
</xs:attribute>

this is not correct, but w3schools says restrictions on attributes are possible, but doesn't explain how, I've looked some further, but even google displays 3 pages full with useless links....
 
oops, appearantly the simpletype tag is not reserved for elements only....

Code:
<xs:attribute name=&quot;Unit&quot; >
    <xs:simpleType>
        <xs:restriction base=&quot;xs:string&quot;>
            <xs:enumeration value=&quot;Degree&quot;/>
            <xs:enumeration value=&quot;Inch&quot;/>
        </xs:restriction>
    </xs:simpleType>
</xs:attribute>

that solved my problem...
next time I'll try not to have assumed some things...

;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top