Hi.
Lets take a look at my test .xsd:
<!-- lot of stuff... -->
<xsd:element name="root">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="target:child"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="child">
<xsd:complexType>
<xsd:attribute name="childAttribute" type="myType"/>
</xsd:complexType>
</xsd:element>
<!-- lot of stuff... -->
Well here is everything fine. There is just one problem: my "child" element dont got a type! I dont know how to give the element a type. I tried with:
<xsd:element name="child" type="xsd:myType2">
<xsd:complexType>
<xsd:attribute name="childAttribute" type="myType"/>
</xsd:complexType>
</xsd:element>
or with
<xsd:element name="root">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="target:child" type="xsd:myType2"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
But it wont work. There is always an error message: "Element 'child' cannot have both a type attribute and a simpleType/complexType type child[xml]]]"
How can i fix this problem? I mean without a type the validator wont allow an xml like this:
Hello World
just an empty child is allowed with one attribute
Somebody any idea? Thank you!