W3C home > Mailing lists > Public > www-forms@w3.org > January 2003

Problem in XForms with dependence of data

From: Asier Ortiz de Urbina <asierurbina@euskalnet.net>
Date: Mon, 27 Jan 2003 23:31:42 +0100
To: www-forms@w3.org
Message-ID: <103a9f10450f.10450f103a9f@euskaltel.es>

Hi,

    I have created this file using XForms:

<head>
  <title>Example</title>
    <xforms:model id="mdlResult">
      <xforms:instance>
        <Country>
          <countryName/>
          <cityName/>
        </Country>
      </xforms:instance>        
    </xforms:model>

    <xforms:model id="mdlData">
      <xforms:instance id="instData">
        <countries>
          <country>France
            <cities>
                <city>Paris</city>
                <city>Lyon</city>
                <city>Burdeaux</city>
            </cities>
          </country>
          <country>Spain
            <cities>
                <city>Madrid</city>
                <city>Barcelona</city>
                <city>Sevilla</city>
            </cities>
          </country>
          <country>Italy
            <cities>
                <city>Roma</city>
                <city>Milano</city>
                <city>Florence</city>
            </cities>
          </country>
        </countries>
      </xforms:instance>
    </xforms:model>

    <link rel="stylesheet" href="/main.css" type="text/css" />
</head>
<body>
  <div class="body">
    <h1>Example</h1>
        <xforms:group ref="xforms:instance('instData')">
          <xforms:select1 model="mdlResult" ref="//countryName" 
style="width:40ex;display:block;">
                <xforms:label>Select a country</xforms:label>
                <xforms:item>
                  <xforms:label>France</xforms:label>
                  <xforms:value>France</xforms:value>
                </xforms:item>
                <xforms:item>
                  <xforms:label>Spain</xforms:label>
                  <xforms:value>Spain</xforms:value>
                </xforms:item>
                <xforms:item>
                  <xforms:label>Italy</xforms:label>
                  <xforms:value>Italy</xforms:value>
                </xforms:item>
          </xforms:select1>

            <xforms:select1 model="mdlResult" ref="//cityName" 
style="width:40ex;display:block;">
                <xforms:label>Select a city</xforms:label>
                <xforms:itemset nodeset="<!--I HAVE THE PROBLEM HERE--
>">
                    <xforms:label ref="."/>
                  <xforms:value ref="."/>
                </xforms:itemset>
          </xforms:select1>                        
                        
        </xforms:group>
  </div>
</body>

    When a person selects a contry in the first "xforms:select1", I 
would like to see in the second "xforms:select1" the names of the 
cities of the selected country. I know I have to use a XPath 
expression in "<!--I HAVE THE PROBLEM HERE-->" but I canīt find the 
appropiate expresion. 
Can somebody help me, please?

    Thank you.

 
 
Received on Tuesday, 28 January 2003 04:16:25 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:21:54 GMT