I'm defining an xml schema for a file that looks something like this:
<data>
<config><segmentcount value="10"/></config>
<foos>
<foo>
<segments>
<segment data="X"/>
<segment data="X"/>
<segment data="X"/>
<segment data="X"/>
<segment data="X"/>
</segments>
</foo>
<foo>
<segments>
...
I've already made a schema for the general structure. However I want to enforce that the number of segment elements in segments is always the same as the value attribute of segmentcount. In the maxOccurs attribute of segments, I tried the xpath /aitt:data/aitt:config/aitt:segmentcount[1]@value
, but the parser told me than maxOccurs has to be a non-negative int or unbounded
.
Is there a trick to do this?
Cheers in advance.