M
monsterpot
Hello,
I have a document like this:
<parameters>
<param ptype="init">somedata</param>
<param ptype="process">moredata</param>
<param ptype="kill">alsodata</param>
</parameters>
<param> has the following definition in my XSD:
<xs:complexType name="param">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="ptype" type="xs:string" use="required" />
</xs:extension
</xs:simpleContent>
</xs:complexType>
The question I have is: I want to require <parameters> elements to
contain exactly 3 <param> elements, and furthermore, to require one
element with the attribute ptype="init", one element with
ptype="process", and another with ptype="kill".
So, for example I want to invalidate this document:
<parameters>
<param ptype="init">somedata</param>
<param ptype="kill">alsodata</param>
</parameters>
because it is missing an element with ptype="process".
I am somewhat new to XSD. Could someone help me?
I have a document like this:
<parameters>
<param ptype="init">somedata</param>
<param ptype="process">moredata</param>
<param ptype="kill">alsodata</param>
</parameters>
<param> has the following definition in my XSD:
<xs:complexType name="param">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="ptype" type="xs:string" use="required" />
</xs:extension
</xs:simpleContent>
</xs:complexType>
The question I have is: I want to require <parameters> elements to
contain exactly 3 <param> elements, and furthermore, to require one
element with the attribute ptype="init", one element with
ptype="process", and another with ptype="kill".
So, for example I want to invalidate this document:
<parameters>
<param ptype="init">somedata</param>
<param ptype="kill">alsodata</param>
</parameters>
because it is missing an element with ptype="process".
I am somewhat new to XSD. Could someone help me?