T
tthunder
Hi @all,
I am trying to set a key constraint in my XML Schema, which concers all
elements containing an attribute named "ID"
My XML example:
<root>
<x ID='1'>
<y ID='2'>
</y>
<y ID='3'>
</y>
<z>
</z>
</x>
<x ID='4'>
</x>
</root>
The problem is to set selector and field...
Of course this works for this example:
<xs:key name="UniqueID">
<xs:selector xpath="x|x/y"/>
<xs:field xpath="@ID"/>
</xs:key>
The problem is, that I have many many different tags. So I want to do
something like this:
<xs:key name="UniqueID">
<xs:selector xpath="*[@ID]"/>
<xs:field xpath="@ID"/>
</xs:key>
But this is not XML schema compatible
Ref:
http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/structures.html#coss-identity-constraint
Any workarounds, ideas, tipps?
Thanks,
Kirsten
I am trying to set a key constraint in my XML Schema, which concers all
elements containing an attribute named "ID"
My XML example:
<root>
<x ID='1'>
<y ID='2'>
</y>
<y ID='3'>
</y>
<z>
</z>
</x>
<x ID='4'>
</x>
</root>
The problem is to set selector and field...
Of course this works for this example:
<xs:key name="UniqueID">
<xs:selector xpath="x|x/y"/>
<xs:field xpath="@ID"/>
</xs:key>
The problem is, that I have many many different tags. So I want to do
something like this:
<xs:key name="UniqueID">
<xs:selector xpath="*[@ID]"/>
<xs:field xpath="@ID"/>
</xs:key>
But this is not XML schema compatible
Ref:
http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/structures.html#coss-identity-constraint
Any workarounds, ideas, tipps?
Thanks,
Kirsten