D
drmccoy
I'm trying to create a key that verify uniqueness hierarchically. Is
that even possible when using XML schema? So far I had no luck. XML
example:
<root>
<As>
<A id='1'>
<Bs>
<B id='1'/>
<B id='2'/>
<B id='3'/>
</Bs>
</A>
<A id='2'>
<Bs>
<B id='1'/>
<B id='2'/>
<B id='3'/>
</Bs>
</A>
</As>
</root>
B always has a parent A, therefore I'd like to have a key that
identifies a specific B that belongs to an A.
This construction fails to do what I want:
<xs:unique name="Unique">
<xs:selector xpath="As/A"/>
<xs:field xpath="@id"/>
<xs:field xpath="Bs/B/@id"/>
</xs:unique>
Any suggestions?
that even possible when using XML schema? So far I had no luck. XML
example:
<root>
<As>
<A id='1'>
<Bs>
<B id='1'/>
<B id='2'/>
<B id='3'/>
</Bs>
</A>
<A id='2'>
<Bs>
<B id='1'/>
<B id='2'/>
<B id='3'/>
</Bs>
</A>
</As>
</root>
B always has a parent A, therefore I'd like to have a key that
identifies a specific B that belongs to an A.
This construction fails to do what I want:
<xs:unique name="Unique">
<xs:selector xpath="As/A"/>
<xs:field xpath="@id"/>
<xs:field xpath="Bs/B/@id"/>
</xs:unique>
Any suggestions?