A
Alex
Hello, XML experts
I'm trying to define an XML schema for documents, which have never
been validated, so their design is far from perfect. For example,
elements with the same tag inside different elements have different
meanings:
<abc>
<def>
<xyz ..... />
</def>
<ghi>
<xyz ..... />
</ghi>
</abc>
I'd like to create a schema, where all the elements are declared at a
global level, and then combine them using references. But it looks
like the element <xyz> can't be defined at global level, cause it
actually has two different types, depending on the parent element:
<xsd:schema ...>
<xs:element name="abc" ...../>
<xs:element name="def" ...../>
<xs:element name="ghi" ...../>
<xs:element name="xyz" ...../> <!-- cannot be here???? -->
</xsd:schema>
Could you please advise how to use the XSD for such case?
Thank you in advance
Alex
I'm trying to define an XML schema for documents, which have never
been validated, so their design is far from perfect. For example,
elements with the same tag inside different elements have different
meanings:
<abc>
<def>
<xyz ..... />
</def>
<ghi>
<xyz ..... />
</ghi>
</abc>
I'd like to create a schema, where all the elements are declared at a
global level, and then combine them using references. But it looks
like the element <xyz> can't be defined at global level, cause it
actually has two different types, depending on the parent element:
<xsd:schema ...>
<xs:element name="abc" ...../>
<xs:element name="def" ...../>
<xs:element name="ghi" ...../>
<xs:element name="xyz" ...../> <!-- cannot be here???? -->
</xsd:schema>
Could you please advise how to use the XSD for such case?
Thank you in advance
Alex