XForms: Problem in XForms with dependence of data

From: Asier Ortiz de Urbina (asierurbina@euskalnet.net)
Date: Wed Jan 22 2003 - 07:27:44 EST

  • Next message: Steve Lamont: "Re: XForms: Problem in XForms with dependence of data"

    # To subscribers of the xforms list from Asier Ortiz de Urbina <asierurbina@euskalnet.net> :

    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 select the contry in the first "xforms:select1", I
    would like see in the second "xforms:select1" the names of the cities
    of the selected country. I know I have 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.

    _________________________________________________
    To unsubscribe, send the message "unsubscribe" to
    xforms-request@bob.usuhs.mil or see
    http://bob.usuhs.mil/mailserv/xforms.html
    XForms Home Page: http://world.std.com/~xforms
    List Archive: http://bob.usuhs.mil/mailserv/list-archives/



    This archive was generated by hypermail 2b29 : Wed Jan 22 2003 - 07:29:43 EST