[Xsltforms-support] indirect indexing through an instance: what is it supposed to do?
Brought to you by:
alain-couthures
From: Efraim F. <efr...@gm...> - 2011-09-04 22:15:54
|
Hi, I'm attaching a test case for a possible bug in XSLTForms. An indirect reference to an item in a nodeset through a numeric index stored in an instance fails (by referencing the first item) unless the index is explicitly typecast to be a number. The examples I give are: Direct: <xf:output ref="instance('data')//html:ul/html:li[2]"/><br/> Indirect (without a cast): <xf:output ref="instance('data')//html:ul/html:li[instance('index')/n]"/><br/> Indirect (cast to a number): <xf:output ref="instance('data')//html:ul/html:li[number(instance('index')/n)]"/> There are two ways the test in the "Indirect (without a cast)" case can be interpreted, though: Take the value, cast it to a number and treat it as an index (what I want it to do), or treat the index as a node test; if the node exists/is > 0, evaluate to true(), otherwise, evaluate to false(). I'm not sure which would be the correct behavior in XPath 1.0! I'm using the latest XSLTForms from svn (rev 508) Thanks, -- --- Efraim Feinstein Lead Developer Open Siddur Project http://opensiddur.net http://wiki.jewishliturgy.org |