XML Tutorial/XML Schema/IDREF — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 11:26, 26 мая 2010
The IDREF data type is derived from the NCName type.
<source lang="xml">
IDREF refers to an element or attribute of type ID in the same instance document. The value for IDREF must match a value for ID in the same instance document.
<xsd:element name="bank">
<xsd:complexType> <xsd:complexContent> <xsd:extension base="xsd:anyType"> <xsd:attribute name="branch" type="xsd:ID"/> </xsd:extension> </xsd:complexContent> </xsd:complexType>
</xsd:element> <xsd:element name="city">
<xsd:complexType> <xsd:complexContent> <xsd:extension base="xsd:anyType"> <xsd:attribute name="branch_division" type="xsd:IDREF"/> </xsd:extension> </xsd:complexContent> </xsd:complexType>
</xsd:element>
<bank branch="412x">Northern</bank> <city branch_division="412x">Chicago</city></source>