473,398 Members | 2,393 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

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

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
Jul 20 '05 #1
0 1217

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Russell O'Connor | last post by:
The following XML and Schema doesn't validate in Visual Studio .NET 2003. Is there some mistake I'm making, or is VS.NET in error. The error is r:\test2.xml(3): The key sequence 'foo' in Keyref...
0
by: mark.van.der.voort | last post by:
Hi, I have defined a simple key/keyref validation for describing a tree. <xs:key name="key_member"> <xs:selector xpath=".//member"/> <xs:field xpath="@id"/> </xs:key> <xs:keyref...
0
by: jacksuyu | last post by:
I have two xsd files, in one xsd file, I defined a "key", I'd like to use "keyref" to refer to that "key" from another xsd file. But I always get attribute is empty error. my.xsd is my first xsd...
2
by: Jaunedeau | last post by:
I have some XML that must look like this : <movies> <movie id="1"> <actor preferredMovieId="1"> <actor preferredMovieId="2"> <actor preferredMovieId="3"> </movie> <movie id="2"> <actor...
1
by: Dmitry Martynov | last post by:
Hi I have a question whether XmlValidatingReader doesn't check keyref constrain (the same with key constraint) or I do smth wrong. I have the following schema <?xml version="1.0"...
2
by: svestin | last post by:
Hi All! I run into a problem defining a XSD schema with KEYREF references. Is it possible to use KEYREF with nillable fields? Just like a database where a FK could be null. In the example...
6
by: Roland Praehofer | last post by:
Hi! I'm trying to accomplish the following: <root xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='teaser.xsd'> <b> <a>John</a> <a>Paul/a>
4
by: jasonnerothin | last post by:
I'm trying to figure out exactly what's going wrong with an xpath keyref validation scenario. In brief, I have something like the following in my xsd: <xs:schema> <xs:complexType...
0
by: Gerry Laenen | last post by:
Hi all, I am currently working on creating an XSD schema. I have an element defined that should be self-refering (child-parent principle). Here is a sample: <GWLC> <GROUPS> <GROUP>...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.