subject:Use Attribute ในเอกสาร XSD
syntax:<xsd:attribute use="value" />
position:<xsd:complexType> ... </xsd:complexType>
content:ใช้กำหนดว่า keyword เพื่อแทนความหมายดังต่อไปนี้
require คือ ต้องมีเสมอ
optional คือ มีหรือไม่มีก็ได้
prohibited คือ ไม่ต้องมีเสมอ
example:<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="football">
<xsd:sequence>
<xsd:element name="stadium" type="xsd:NMTOKEN" />
<xsd:element name="manager" type="xsd:NMTOKEN" />
<xsd:element name="footballer" type="xsd:NMTOKEN" />
</xsd:sequence>
<xsd:attribute name="logo" type="xsd:NMTOKEN" use="require" />
</xsd:complexType>
</xsd:schema>