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

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

From: Mark Seaborne <MSeaborne@origoservices.com>
Date: Mon, 18 Nov 2002 14:34:44 -0000
Message-ID: <DC65AE678B89004B9CCB202E19482CC704FB6C@mail.origoservices.local>
To: <XForms@yahoogroups.com>
Cc: <www-forms@w3.org>



Well, there is a schema, and I take your point about the value of @id. However, given that all I'm actually doing is attempting to establish that one attribute in one part of a XML structure has the same value as another attribute in another part of a XML structure, I'm not sure that either point help directly. In fact, I'm not really making use of the fact the two attributes are of type xsd:id and xsd:idref, am I?

I just wondered if anyone thinks that :

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

ought, theoretically to work. 

Specifically, can I use index() to return the position of the current person node in the nodeset generated by the xfm:repeat?

If not, maybe I need to take a quite different approach to the problem?

All the best


-----Original Message-----
From: AndrewWatt2001@aol.com [mailto:AndrewWatt2001@aol.com]
Sent: 18 November 2002 14:06
To: XForms@yahoogroups.com
Cc: www-forms@w3.org
Subject: Re: [XForms] ID/IDREF relationships in XML instances

In a message dated 18/11/2002 13:57:24 GMT Standard Time, MSeaborne@origoservices.com writes:

    <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.


Your problem may be totally unrelated but as I read through your code the first thing that struck me is that you are using an illegal value for the id attribute on the <person> element.

The value of an ID attribute may not start with a numeric character. So id="1" is illegal.

Secondly, the fact that an attribute has the name "id" does not automatically make it an ID attribute. There needs to be a DTD/schema which states that. You don't state whether such a DTD/schema exists.

Either or both of those possible problems would stop an XML processor treating your code as if it had a legal ID attribute present.

I hope that helps a little.

Andrew Watt 
To unsubscribe from this group, send an email to:

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
Received on Monday, 18 November 2002 09:35:14 UTC

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