XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 14th, 2004, 07:08 AM
monkeyboy02 monkeyboy02 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 1 monkeyboy02 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question xs:unique question when writing XML Schema

Hi,

I am writing an XML Schema document and am stuck when defining the document's complex types. I wish to define a complex type containing 0-many elements which must be unique by name. Below is an example of what I'm trying to achieve:
Code:
...
<xs:complexType name="typeA">
  <xs:sequence>
    <xs:element name="parameter" type="jparameter" minOccurs="0" maxOccurs="unbounded"/>
  </xs:sequence>
  <xs:unique name="parameter-name-uniqueness">
    <xs:selector xpath="parameter"/>
    <xs:field xpath="@name"/>
  </xs:unique>
</xs:complexType>
...

As you can see, I wish to keep all 'jparameter' elements unique within the 'typeA' type, which is why the xs:unique tag is inside typeA's tag. It appears however that xs:unique tags can only appear inside xs:element tags, which would prevent me from defining the above common type to be reused.

Can anyone offer a workaround, perhaps my schema layout is flawed?

Cheers

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > xs:unique question when writing XML Schema


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT