องค์ประกอบ XML Schema attributeGroup
ความหมายและการใช้งาน
องค์ประกอบ attributeGroup จะใช้ในการประกาศแอตทริบิวต์จะรวมกันเพื่อให้งบเหล่านี้สามารถรวมถึงรูปแบบที่ซับซ้อนออกเป็นประเภท
องค์ประกอบข้อมูล
- องค์ประกอบหลัก: attributeGroup, complexType คี จำกัด (ทั้ง simpleContent และ complexContent) ส่วนขยาย (ทั้ง simpleContent และ complexContent)
ไวยากรณ์
<attributeGroup
id=ID
name=NCName
ref=QName
any attributes
>
(annotation?),((attribute|attributeGroup)*,anyAttribute?))
</attributeGroup>
id=ID
name=NCName
ref=QName
any attributes
>
(annotation?),((attribute|attributeGroup)*,anyAttribute?))
</attributeGroup>
(เข้าสู่ระบบประกาศองค์ประกอบ attributeGroup องค์ประกอบสามารถเกิดขึ้นได้เป็นศูนย์หรือครั้งเดียว * สัญญาณบอกว่าองค์ประกอบที่สามารถเกิดขึ้นได้เป็นศูนย์หรือมากกว่าครั้ง.)
属性 | 描述 |
---|---|
id | 可选。规定该元素的唯一的 ID。 |
name | 可选。规定属性组的名称。name 和 ref 属性不能同时出现。 |
ref | 可选。规定对指定的属性组的引用。name 和 ref 属性不能同时出现。 |
any attributes | 可选。规定带有 non-schema 命名空间的任何其他属性。 |
ตัวอย่างที่ 1
<xs:attributeGroup name="personattr">
<xs:attribute name="attr1" type="string"/>
<xs:attribute name="attr2" type="integer"/>
</xs:attributeGroup>
<xs:complexType name="person">
<xs:attributeGroup ref="personattr"/>
</xs:complexType>
<xs:attribute name="attr1" type="string"/>
<xs:attribute name="attr2" type="integer"/>
</xs:attributeGroup>
<xs:complexType name="person">
<xs:attributeGroup ref="personattr"/>
</xs:complexType>
ตัวอย่างข้างต้นกำหนดกลุ่มอสังหาริมทรัพย์ที่ชื่อ "personattr" ใช้ชนิดที่ซับซ้อนชื่อ "บุคคล" ใน
XML Schema สมบูรณ์อ้างอิง