Franp - 2008-03-05

Hi,

I hope I am not bothering you people by submitting the following issue, a perfect XForms newbee issue probably...

Please consider the following :
I cannot get calculate="//tarifSeul/csA/*[name()=//famille/age1]" to work. It produces nothing and the XPath count() gives 0.
Am I missing something there ?
Many thanks for any help.

<!DOCTYPE
  html PUBLIC "-//W3C//DTD XHTML 1.0//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html
    xmlns="http://www.w3.org/1999/xhtml"
        xmlns:xf="http://www.w3.org/2002/xforms"
        xmlns:ev="http://www.w3.org/2001/xml-events"
        xml:lang="fr">

<head>
    <title>XForms : Calcul tarifaire</title>

    <meta http-equiv="content-type" content="text/html;charset=utf-8" />

<script type="text/javascript" src="Scripts/formfaces.js"></script>

    <xf:model id="model">
          <xf:instance>
          <fiche xmlns="">
            <famille>
                <ddn1>1987</ddn1>
                <age1/>
                <primeSingle>
                    <csA/>
                </primeSingle>
            </famille>

            <tarifSeul>
                <csA>
                    <age21>19.07</age21>
                    <age22>20.58</age22>
                </csA>
            </tarifSeul>

        </fiche>
        </xf:instance>

    <xf:bind nodeset="famille/age1" calculate="if(../ddn1 != '', concat('age', 2008 - ../ddn1), '')" />

    <!-- Works -->
    <!--
    <xf:bind nodeset="famille/primeSingle/csA" calculate="//tarifSeul/csA/*[name()='age21']" />
    -->

    <!-- Doesn't work -->
    <xf:bind nodeset="famille/primeSingle/csA" calculate="//tarifSeul/csA/*[name()=//famille/age1]" />

    </xf:model>

</head>

<body>

<p>
<xf:output ref="famille/age1" /> -:- <xf:output ref="famille/primeSingle/csA" /> €/mois.
</p>

</body>
</html>