[Xsltforms-support] Bind to an attribute within a repeat
Brought to you by:
alain-couthures
From: Elias M. <eli...@gm...> - 2013-01-08 21:08:15
|
Hi. I need to bind an attribute of an element to an integer. This element is part of a repeat. Here is what the code looks like: ----------- <?xml-stylesheet href="../xsltforms/xsltforms.xsl" type="text/xsl"?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf=" http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <head> <title>Test XForms</title> <xf:model> <xf:instance id="my"> <data xmlns=""> <Elem1> <id seq="1">1</id> </Elem1> <Elem1> <id seq="2">2</id> </Elem1> </data> </xf:instance> <xf:bind nodeset="instance('my')/Elem1/id@seq" type="xsd:integer"/> </xf:model> </head> <body> <p>Testing....</p> <xf:repeat id="rep" ref="instance('my')/Elem1"> <xf:input id="seqnum" ref="./id@seq"> <xf:label>Seq: </xf:label> <xf:alert>Must be integer</xf:alert> </xf:input> <br/> <xf:input id="theid" ref="./id"> <xf:label>Id: </xf:label> </xf:input> <br/><br/> </xf:repeat> </body> </html> ____ It works fine if there are no repeat and it's a single node. Doesn't work like this with multiple nodes and the repeat. Any help is appreciated. Thanks. Elias |