Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


keyref with empty sets

From: Nigel Hardy <nwh@----.--.-->
To: xmlschema-dev@--.---
Date: 5/28/2004 12:22:00 PM
I have the following snippet of schema:

  <xs:element name="Admin">

    <xs:complexType mixed="false">

      <xs:sequence>

        <xs:element ref="UserSet"      minOccurs="0" maxOccurs="1"/>

        <xs:element ref="ExperimentSet" minOccurs="0" maxOccurs="1"/>

      </xs:sequence>

    </xs:complexType>

    <xs:keyref name="ExperimentAssocRef" refer="UserKey">

      <xs:selector xpath="ad:ExperimentSet/ad:Experiment"/>

      <xs:field xpath="ad:userID"/>

      <!-- the implementation of ResponsibleFor -->

    </xs:keyref>

  </xs:element>

All experiments must have a user responsible for them. We can have a set 
of users with no associated experiments, but I also want the possibility 
of having an empty Admin element. UserKey is defined over the elements 
of UserSet.

When I set up a test with no experimentSet (but some users in the 
userSet) that's fine.

With a completely empty Admin element I am told there is a "keyref which 
refers to a key or unique that is out of scope" (using Java Xerces).

So I see that when there were just users there were values of UserKey 
but no Experiment happened to refer to them. I had not expected that 
when there were no users either I would have a problem that there were 
no users for experiments not to reference :-)

Where am I adrift?
Thanks

    Nigel




-- 
---------------------------------------------------------------------
Nigel Hardy     Tel: +44 1970 622 434.   http://users.aber.ac.uk/nwh/
  Dept. Computer Sci,  University of Wales, Aberystwyth, SY23 3DB, UK
  Adran Cyfrifiadureg, Prifysgol Cymru,     Aberystwyth, SY23 3DB, UK




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent