thats a part of my xml file:
<MY_ATTRIBUTES>
<ATTRIBUTES>
<ID>first_id</ID>
<TYPE>first_type</TYPE>
<FILE1>my_file1</FILE1>
</ATTRIBUTES>
<ATTRIBUTES>
<ID>second_id</ID>
<TYPE>second_type</TYPE>
<FILE2>my_file2</FILE2>
<FILE3>my_file3</FILE3>
</ATTRIBUTES>
</MY_ATTRIBUTES>
I need to write the corresponding xsd file. my problem is that number and name of the elements depends on the text of the TYPE element. I tried to do this via xs:alternative but I wasn't successful with that:
<xs:element name="TYPE" type="xs:string">
<xs:alternative test="text() eq first_type'" type="first_type"/>
<xs:alternative test="text() eq second_type'" type="second_type"/>
</xs:element>
<xs:complexType name="first_type">
<xs:sequence>
<xs:element name="TYPE" type="xs:string" fixed="first_type"/>
<xs:element name="FILE1" type="xs:string"/>
</xs:sequence>
</xs:complexType>
any idea how this is possible?