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

absolute/relative ref and model-ref 'inheritance'

From: Kurt George Gjerde <kurt.gjerde@intermedia.uib.no>
Date: Mon, 26 Aug 2002 16:16:16 +0200 (MET DST)
To: <www-forms@w3.org>
Message-ID: <Pine.GSO.4.33.0208261614450.2381-100000@hermes.svf.uib.no>


A few questions about absolute/relative xpaths in @ref,
and about model reference "inheritance".

-1- ref

Take this form:

        <name>XForms 1.0</name>
  <group ref="project">
    <input ref="name">
      <label>Project name</label>
    <input ref="/person/name">
      <label>Person name</label>

I assume that

  'Project name' will be "XForms 1.0"
  (ref 'project' + relative ref 'name' = /project/name)

  'Person name' will be "Janet"
  (absolute ref = /person/name).

Correct? This seems logical to me (see 9.1.1, also quoted below) but
I've seen implementations rendering the second input's ref as
/project/person/name (or /project//person/name!)
(ignoring the initial slash in the @ref).

-2- model

About the @model attribute the (new) WD says (3.2.3): "required, except
when the bind attribute is present".

The group UI element can take single node binding attributes; WD says
(9.1.1): "The binding expression is *solely* for the purpose of authoring
convenience; it allows controls appearing within element 'group' to use
relative XPath expressions." Doesn't mention model, and model isn't

Now, are model references 'inherited' down to child element controls? Or
they have to be explicitly set for each and every control?

  <model id="city"/>
  <model id="fishpond"/>

  <group model="fishpond">
    <input ref="size"/>

Would this be 'size' in the 'fishpond' model or in the default model
('city')? The former I hope.

-3- both

If it's the size of the fishpond...

Take the following form:

  <model id="mod-ocean">

  <model id="mod-pond">

  <group ref="size">

    <input ref="width">
      <label>Ocean width</label>

    <group model="mod-pond">
      <input ref="depth">
        <label>Pond depth</label>


Would the @ref in the second input ('pond depth'; in model mod-pond) be
relative to the @ref in the top group element? Would it be
{mod-pond}/size/depth or just {mod-pond}/depth?

I assume (and hope) the former is correct, and that this is just a
weird example (you get what you ask for).

Very grateful for any input,
kurt george gjerde <kurt.gjerde@intermedia.uib.no>
intermedia uib, university of bergen
Received on Monday, 26 August 2002 10:16:41 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:37:44 UTC