Here it is. I reference my own server for the ubiquity library and
for a script that prints out the submitted XML. The instance is
a hacked up version of an example I found on the web.
Sorry I don't remember where I got it but somebody else out there
deserves the credit for that.
In my environment when I run this thing it loads up Ubiquity then
sits there. I hit the submit button and then do a "back" and
it loads Ubiquity again and shows "Ok". The first time it should
have said "Ok" also but didn't. The second time I submit I see that
the position() function binds have done their thing. So all of the
binds only work on the second time around. I think there must
be some missing event on the initial load.
This example doesn't have the explicit action tag on xforms-ready
event. I can work up an example for that if needed.
<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">
<head>
<title> An XForms Example</title>
<script src="
http://flash.yipyap.com/ubiquity-xforms-read-only/src/
ubiquity-loader.js" type="text/javascript">/**/</script>
</head>
<body>
<xf:model>
<xf:instance>
<Data xmlns="">
<currentLot/>
<currentItem/>
<Lot code="">
<Item code=""/>
<Item code=""/>
</Lot>
<Lot code="">
<Item code=""/>
<Item code=""/>
</Lot>
<Lot code="">
<Item code=""/>
<Item code=""/>
</Lot>
</Data>
</xf:instance>
<xf:bind nodeset="/Data/currentLot" calculate="string('OK!')"/
>
<xf:bind nodeset="/Data/Lot/@code" calculate="position()"/>
<xf:bind nodeset="Lot[@code]/Item/@code" calculate="position
()"/>
<xf:submission action="
http://flash.yipyap.com/cgi-bin/list2"
method="post" id="sendStuff" includenamespaceprefixes=""/>
</xf:model>
<hr />
<xf:output ref="/Data/currentLot"><xf:label>currentLot</xf:label></
xf:output>
<hr />
<xf:submit submission="sendStuff"><xf:label>Echo</xf:label></
xf:submit>
<hr />
done
</body>
</html>