|
Subject:
|
Read xpath query from node value
|
|
Posted By:
|
jaquing
|
Post Date:
|
1/9/2006 1:39:09 PM
|
I would like to populate a drop list with options from an XML doc. However each option has disply/no-display conditions.
How can I execute the xpath query contained in the doc and check the true/false result condition?
ie( <optionNodeRoot> <option> <value>blah1</value> <show>../../stepID = 1</show> </option> <option> <value>blah2</value> <show>../../stepID = 2</show> </option> <option> <value>blah3</value> <show>../../stepID = 3</show> </option> </optionNodeRoot>
|
|
Reply By:
|
mhkay
|
Reply Date:
|
1/9/2006 3:20:50 PM
|
There's no standard way of doing dynamic XPath evaluation in XSLT (1.0 or 2.0). A number of products have an extension function, usually called xx:evaluate(). Saxon also has saxon:evaluate-node() which is designed specifically for the use case where the XPath expression is within a source document and relative to the node it is contained in. Alaternatively, call out to a selectSingleNode() or similar method in JavaScript.
Michael Kay http://www.saxonica.com/ Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
|
|
Reply By:
|
jaquing
|
Reply Date:
|
1/11/2006 5:50:28 PM
|
Great, thanks for the reply. I'll look up usage of the evaluate() function available in InfoPath 2003
|