[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

xsd uniqueness on element names?

  • From: seanwhalen@c...
  • To: xml-dev@l...
  • Date: Sun, 08 Jul 2007 17:52:28 +0000

xsd uniqueness on element names?


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


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.