How to write xsd for the following xml?
I have the following XML:
<xml>
<columns>
<column fruit="apple" />
<column fruit="peach" />
</columns>
<items>
<item date="10.10.2009">
<apple price="3" />
<peach price="5" />
</item>
<item date="10.10.2010">
<apple price="4" />
<peach price="2" />
</item>
</items>
</xml>
Inside xml.columns.item
tag can be tags with the same name as defined in xml.columns..@fruit
attribute and in the same order. All tags inside xml.columns.item
are always ha开发者_开发百科ve the same attribute xml.columns.item..@price
.
Does anybody know how to define this in XSD?
You can't represent this in XSD. If you are looking to cross reference data then you should look at using ID/IDREF types. Chek ID/IDREF: sample solution
精彩评论