Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


xsd uniqueness on element names?

From: seanwhalen@-------.---
To: xml-dev@-----.---.---
Date: 7/8/2007 5:53:00 PM
Hi,
	I have a question about how to implement a uniqueness constraint that tests for uniqueness on element names.  I worked through examples that use attribute values and element values, but I wasn't able to get the xsd:unique element to test for element names.  The following is a description of a sample schema:

<ROOT>
	<Basket>
		<Animals>...</Animals>
		<Vegetables>...</Vegetables>
		<Minerals>...</Minerals>
	</Basket>
</ROOT>


	I'd like the schema to limit the contents of the Basket element to a unique set of "Animals", "Vegetables", or "Minerals" elements, which wrap more specific elements that represent members of those categories.  

	I've gotten the functional affect of what I want by limiting each of the three categories to only appear zero or one times, but I'm still curious about whether or not using xsd:unique or xsd:key is possible.  The technical problem seemed to be that xpath functions like "local-name()" were not part of the restricted xpath set that is valid for unique "field" attribute.  Is that the entire issue, or is there a more abstract principle behind not allowing node names in uniqueness tests?  

     Any help or tips would be greatly appreciated,

Sean


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent