This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
So for each Person/Address you require non-duplicate country elements? Why not just say that in your schema then?
Joined: Jul 09, 2009
In schema I used
<xs:unique name="country_Constraint1" msdata:ConstraintName="Constraint1" >
<xs:selector xpath=".//Address" />
<xs:field xpath="country" />
But it wont allow dupliacte country name in all address fields..that is not specific to person/address
My requirement is limiting the scope of uniqueness under each person
Well, I know basically nothing about schema. So that's why I just made a general suggestion in my earlier post, rather than attempting to produce an actual correct schema. But you seem to have avoided paying attention to it. So let me have a go at changing your schema:
Now, that probably won't work either. I don't understand how the schema sets the context node for an XPath expression. But you're the one using schemas so perhaps you do. At any rate I leave you to fix it up.