1
我附上我的XSD的刪減版本如何創建XSD架構與
<?xml version="1.0" encoding="UTF-8"?>
<xs:complexType name="School_ip_details">
<xs:sequence>
<xs:element type="xs:string" name="Tarun_Name" />
<xs:element type="xs:string" name="Tarun_IP" />
<xs:element type="xs:string" name="Tarun_Subnet" />
</xs:sequence>
</xs:complexType>
<xs:element name="CLASSESS">
<xs:complexType>
<xs:sequence>
<xs:element name="Taruns">
<xs:complexType>
<xs:sequence>
<xs:element name="Tarun" maxOccurs="127">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="Tarun_Name" />
<xs:element type="xs:string" name="Tarun_Prefix" />
<xs:element type="xs:string" name="Tarun_Subnet" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Schools">
<xs:complexType>
<xs:sequence>
<xs:element name="School">
<xs:complexType>
<xs:sequence>
<xs:element name="School_IPdetails" type="School_ip_details" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:keyref name="TarunRef" refer="TarunKey">
<xs:selector xpath="." />
<xs:field xpath="./School/School_IPdetails/Tarun_Name" />
</xs:keyref>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:key name="TarunKey">
<xs:selector xpath="./Taruns/Tarun/Tarun_Name" />
<xs:field xpath="." />
</xs:key>
<xs:key name="TarunIPKey">
<xs:selector xpath="./Taruns/Tarun/Tarun_Prefix" />
<xs:field xpath="." />
</xs:key>
</xs:element>
在這裏,我要實現以下情形字段之間的關係。當我提到從CLASSES/Taruns/Tarun/Tarun_Name
到CLASSES/Scools/School/School_ip_details/Tarun_Name
那麼CLASSES/Taruns/Tarun/Tarun_Prefix
針對特定Tarun_Name
值應在CLASSES/Scools/School/School_ip_details/Tarun_IP
體現任何價值,請幫助我爲同一
我使用了以下代碼byt no benefit \t \t \t –