XML Schema attributeGroup 元素
定义和用法
attributeGroup 元素用于对属性声明进行组合,这样这些声明就能够以组合的形式合并到复杂类型中。
ఎలిమెంట్ సమాచారం
ప్రక్రియా గణన | వినియోగించబడని అంశం |
ప్రాతిపదిక | attributeGroup、complexType、schema、restriction (simpleContent)、extension (simpleContent)、restriction (complexContent)、extension (complexContent) |
కంటెంట్ | annotation、attribute、attributeGroup、anyAttribute |
సింహావళి
<attributeGroup id=ID name=NCName ref=QName ఏదైనా అట్రిబ్యూట్స్ > (annotation?),((attribute|attributeGroup)*,anyAttribute?)) </attributeGroup>
(? సింబోల్ అట్రిబ్యూట్గ్రూప్ లో పేర్కొనబడింది,ఎలిమెంట్ ఒకసారి లేదా ఎక్కువ సార్లు కనుగొనబడవచ్చు,* సింబోల్ ఎలిమెంట్ ఒకసారి లేదా ఎక్కువ సార్లు కనుగొనబడవచ్చు。)
అట్రిబ్యూట్ | వివరణ |
---|---|
id | ఆప్షనల్. ఈ ఎలిమెంట్పై యునిక్ ఐడి నిర్దేశిస్తుంది. |
name | ఆప్షనల్. అట్రిబ్యూట్ గ్రూప్పై నామకరణం నిర్దేశిస్తుంది. name మరియు ref అట్రిబ్యూట్లు ఒకేసారి కనుగొనబడలేదు. |
ref | ఆప్షనల్. నిర్దేశించిన అట్రిబ్యూట్ గ్రూప్పై సూచించు. name మరియు ref అట్రిబ్యూట్లు ఒకేసారి కనుగొనబడలేదు. |
ఏదైనా అట్రిబ్యూట్స్ | ఆప్షనల్. నాన్-షేమా నేమ్స్పేస్ కలిగిన ఏదైనా ఇతర అట్రిబ్యూట్లను నిర్దేశిస్తుంది. |
ఇన్స్టాన్స్
<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>
పైని ఉదాహరణ ఒక "personattr" అంశగుంపును నిర్వచించింది, అది "person" కమ్పోజిట్ రకంలో ఉపయోగించబడుతుంది.