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

ID/IDREF relationships in XML instances

From: Mark Seaborne <MSeaborne@origoservices.com>
Date: Mon, 18 Nov 2002 13:57:42 -0000
Message-ID: <DC65AE678B89004B9CCB202E19482CC704FB6B@mail.origoservices.local>
To: <XForms@yahoogroups.com>, <www-forms@w3.org>


I am trying to author a simple XForms form that allows someone to edit the following:

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

There can be more than one <person>, more than one <address> and more than one person/@address_id can point to one address/@id.

First off, I want to build a form that displays a <person>, along with its associated <address>.

This must be a fairly simple job, but I am afraid I have been looking at it for too long to see how to accomplish it.

Might something along the following lines work? 

I have tried the index() function, hoping it will give me the current <person> in the <xfm:repeat>. I am not convinced that I am using it correctly though:

		<xfm:repeat nodeset="person" id="people">
			<!-*person details here*-->
			<xfm:group id="address" 
			ref="../address[@id = ../person[index('people')]/address/address_id]">
			<!-*Address here-->

Any ideas, or pointers to relevant examples would be much appreciated.

All the best

Mark Seaborne
Received on Monday, 18 November 2002 09:39:43 UTC

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