I'm trying to use the calculate feature but cannot get it working. I think i'm doing something working. I have managed to get this working using value but not bind. You can see to samples below.
Any help would be much appreciated.
Thanks,
Daniel
Output = "a b c d" - WRONG!
<xhtml:html xmlns:xforms="
http://www.w3.org/2002/xforms" xmlns:xhtml="
http://www.w3.org/1999/xhtml"> <xhtml:head>
<xforms:model>
<xforms:instance>
<root>
<items>
<item>a</item>
<item>b</item>
<item>c</item>
<item>d</item>
</items>
</root>
</xforms:instance>
<xforms:bind nodeset=".">
<xforms:bind id="mycount" nodeset="items" calculate="count(*)" />
</xforms:bind>
</xforms:model>
</xhtml:head>
<xhtml:body>
<xforms:output bind="mycount" />
</xhtml:body>
</xhtml:html>
Output = "4" - CORRECT!
<xhtml:html xmlns:xforms="
http://www.w3.org/2002/xforms" xmlns:xhtml="
http://www.w3.org/1999/xhtml"> <xhtml:head>
<xforms:model>
<xforms:instance>
<root>
<items>
<item>a</item>
<item>b</item>
<item>c</item>
<item>d</item>
</items>
</root>
</xforms:instance>
<xforms:bind nodeset=".">
<xforms:bind id="mycount" nodeset="items" />
</xforms:bind>
</xforms:model>
</xhtml:head>
<xhtml:body>
<xforms:output bind="mycount" value="count(*)" />
</xhtml:body>
</xhtml:html>