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

J

J E E

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top