473,387 Members | 1,440 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,387 software developers and data experts.

keyref refer to another xsd's "key"

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 file with "key", myphone.xsd is the keyref file
which need to refer to the "key"

Thanks.

my.xsd:

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.fisc.com" xmlns:fs="http://www.fisc.com"
targetNamespace="http://www.fisc.com" elementFormDefault="qualified">
<xs:element name="name" type="xs:string"/>
<xs:element name="cubic">
<xs:complexType>
<xs:sequence>
<xs:element ref="name"/>
<xs:element name="devices" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:any namespace="##any" processContents="skip"
maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="office">
<xs:complexType>
<xs:sequence>
<xs:element ref="cubic" minOccurs="2" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:key name="test0">
<xs:selector xpath="fs:cubic/fs:name"/>
<xs:field xpath="."/>
</xs:key>
</xs:element>
</xs:schema>
myphone.xsd:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:yb="http://www.yellowbook.com"
targetNamespace="http://www.yellowbook.com"
elementFormDefault="qualified" attributeFormDefault="unqualified"
xmlns:fs="http://www.fisc.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.fisc.com C:\proj\xmlschema\my.xsd">
<xs:element name="phone">
<xs:annotation>
<xs:documentation>Comment describing your root
element</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="shareWith" type="xs:string"/>
<xs:element name="phoneNumber" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
<xs:keyref name="shareWithKeyRef" refer="fs:test0">
<xs:selector xpath="yb:phone/yb:shareWith"/>
<xs:field xpath="."/>
</xs:keyref>
</xs:element>
</xs:schema>

Sep 19 '05 #1
0 1551

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

Similar topics

0
by: jy2003 | last post by:
1. Does MyISAM support FOREIGN KEY constraints? When I read the online MySQL Reference Manual, it said "InnoDB also supports FOREIGN KEY constraints". Does it mean MyISAM does not support FOREIGN...
2
by: microsoft | last post by:
When I create a instance of web services proxy in winform, I get the exception. Stack Trace: System.ArgumentException: Item has already been added. Key in dictionary:"winbootdir" Key being...
1
by: Holger (David) Wagner | last post by:
Hi there, we have an application which is built with several ASCX controls some of which contain form elements (e.g. Textboxes, Buttons etc.) For example: in the top section (one...
5
by: Steven | last post by:
Can anyone tell me how to toggle the "Caps Lock" key? Thanks in advance
0
by: Ralf Gedrat | last post by:
Hello! I have a Application, this throws after some time following exception: Item has already been added. Key in dictionary: "- 1" key being added: "- 1" I use Application.Run with...
8
by: Nick | last post by:
I have a table with columns (product_id,related_product_id,related_counter) If product A is related to product B then a record should be created, if the record already exists then the...
3
by: Boki | last post by:
Hi All, Could you please advice that how to detect the enter "key" event.... due to I don't want another button to do "Go" function..... Best regards, Boki.
2
by: Alex Maghen | last post by:
Hi. Two questions about "RegisterClientScriptBlock": 1. I want to be able to insert a script block without having to worry about whether the "key" is unique. As it turns out, if a script block...
0
by: Ismail Fatih Yıldırım | last post by:
I modified the RSACSPSample from MSDN to try out a simple commutative encryption model using RSA encryption but when i run the progrem the first encryption command works but during the second...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.