W3C home > Mailing lists > Public > www-forms@w3.org > November 2002

RE: [XForms] ID/IDREF relationships in XML instances

From: Roland Merrick <roland_merrick@uk.ibm.com>
Date: Tue, 19 Nov 2002 13:32:20 +0000
To: "Mark Seaborne" <MSeaborne@origoservices.com>
Cc: www-forms@w3.org
Message-ID: <OF85BDA335.91DD266A-ON80256C76.004866D0@portsmouth.uk.ibm.com>
Greetings Mark, I have seen the scenario you describe once before.

Copying values from one part of an instance to another can be achieved 
using <setvalue>.

The complication in what you are trying to do is the use of attributes of 
type id within a repeat. Because of the uniqueness requirement we do not 
copy ids when we insert an element into a repeat.

However, should your application be able to define the maximum number of 
<person>s and <address)es you could predefine a set of empty ones but with 
predefined ids (which I'm assuming you do not show the user).

Then, for example, when a user selects "the second address they supplied" 
as the abode for "this person" a <setvalue> could be used in an event 
handler to copy the appropriate id value.

Regards, Roland

"Mark Seaborne" <MSeaborne@origoservices.com>
Sent by: www-forms-request@w3.org
18/11/2002 15:59

        To:     <AndrewWatt2001@aol.com>
        cc:     <XForms@yahoogroups.com>, <www-forms@w3.org>
        Subject:        RE: [XForms] ID/IDREF relationships in XML instances



Thanks for clearing that up then :)

All I want to do is to have a form that understands and maintains the 
relationship between the address and person in the XML below:

<address id="a">
<line_1>4 Heronimous Road</line_1>
<postcode>SK1 1KS</postcode>
<person id="i">
<address address_id="a"/>

where both person and address repeat, one person may have only one 
address, but one address can be linked to none or more persons. Maybe I 
should be expressing something like this in the schema, or in the model? 
Thinking about it, perhaps keys would do the trick?

Any other advice, or experience would certainly be welcomed.

All the best

Received on Tuesday, 19 November 2002 08:33:00 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:07 UTC