Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Can't use key and keyref with an attribute in a group

Reply
Thread Tools

Can't use key and keyref with an attribute in a group

 
 
J E E
Guest
Posts: n/a
 
      11-07-2003
Hi,

Why can't I create a key and keyref with an attribute declared in an
attribute group? Code below describes what I'm trying to accomplish.

<!-- An attribute group -->
<xs:attributeGroup name="AttGMain">
<xs:attribute name="Name" type="xs:string" />
<xs:attribute name="Type" type="xs:string" />
</xs:attributeGroup>

<!-- CT using group above -->
<xs:complexType name="ctView">
<xs:all>
<xs:element name="Control" type="ctControl" />
<xs:element name="InfoView" type="ctInfoView" />
</xs:all>
<xs:attributeGroup ref="AttGMain" />
</xs:complexType>

<!-- CT using CT above for View element -->
<xs:complexType name="ctViewGroup">
<xs:sequence>
<xs:element name="View" type="ctView">
<xs:key name="ViewPK">
<xs:selector xpath="." />
<xs:field xpath="@Name" />
</xs:key>
<xs:keyref id="ViewFK" refer="ViewPK">
<xs:selector xpath=".//View" />
<xs:field xpath="@Name" />
</xs:keyref>
</xs:element>
</xs:sequence>
</xs:complexType>

No relations are defined when I use Name attribute in a group, but
works when Name is declared local in ctView.

Regards,
J E E
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problems with key/keyref and complex-type inheritance peterpeter XML 0 02-12-2007 08:17 PM
key and keyref Mike XML 3 09-27-2005 09:35 AM
Xml Schema substitution groups / key and keyref John Carron XML 0 09-01-2005 06:52 PM
Key-keyref to attribute in root element Russell O'Connor XML 5 04-27-2004 08:32 AM
XML schema - key/keyref and inheritance peterpeter XML 0 02-11-2004 01:38 PM



Advertisments