R
Robert Dunn
Hi,
I'm interested in creating a schema that enforces a node tree based on
an attribute. For example:
<Invocation type="COM">
<GUID>{63D94CD7-C566-457D-B011-D544483D7862}</GUID>
</Invocation>
<Invocation type="DCOM">
<MachineName>IITWEB-1</MachineName>
<GUID>{63D94CD7-C566-457D-B011-D544483D7862}</GUID>
</Invocation>
<Invocation type="DLL">
<Location>C:\Temp\Product.dll</Location>
</Invocation>
Is this possible? At the moment I've got the schema with a choice
around MachineName, GUID and Location but ultimately it would be nice
to enforce the relationship between the nodes and the attribute.
Current schema:
<xs:element name="Invocation">
<xs:complexType>
<xs:choice>
<xs:element ref="MachineName" minOccurs="0"/>
<xs:element ref="GUID" minOccurs="0"/>
<xs:element ref="Location" minOccurs="0"/>
</xs:choice>
<xs:attribute name="type" use="required">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="COM"/>
<xs:enumeration value="DCOM"/>
<xs:enumeration value="DLL"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
Thanks,
Rob.
I'm interested in creating a schema that enforces a node tree based on
an attribute. For example:
<Invocation type="COM">
<GUID>{63D94CD7-C566-457D-B011-D544483D7862}</GUID>
</Invocation>
<Invocation type="DCOM">
<MachineName>IITWEB-1</MachineName>
<GUID>{63D94CD7-C566-457D-B011-D544483D7862}</GUID>
</Invocation>
<Invocation type="DLL">
<Location>C:\Temp\Product.dll</Location>
</Invocation>
Is this possible? At the moment I've got the schema with a choice
around MachineName, GUID and Location but ultimately it would be nice
to enforce the relationship between the nodes and the attribute.
Current schema:
<xs:element name="Invocation">
<xs:complexType>
<xs:choice>
<xs:element ref="MachineName" minOccurs="0"/>
<xs:element ref="GUID" minOccurs="0"/>
<xs:element ref="Location" minOccurs="0"/>
</xs:choice>
<xs:attribute name="type" use="required">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="COM"/>
<xs:enumeration value="DCOM"/>
<xs:enumeration value="DLL"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
Thanks,
Rob.