Using ${answer} with xpath_eval
Posted: Fri Feb 08, 2019 4:36 am
Hi there,
In a document template, I prompt the user for their id value using the ${ask} editor variable like so:
Which works perfectly well. However, when I try to use that value within an xpath_eval, it fails:
The '${people}' editor variables works fine as does (doc('../people.xml')), but the answer does not. I've tried escaping with multiple quotation marks and I've tried casting the answer to a string using another embedded xpath_eval (a long shot, but thought it might be worth it), but no luck. Is this something that can be done?
Thanks!
Best,
Joey
In a document template, I prompt the user for their id value using the ${ask} editor variable like so:
Code: Select all
<name ref="pers:${ask('Your xml:id', String,'', @user_id)}">
Code: Select all
${xpath_eval(doc('${people}')//*:person[@xml:id='${answer(@user_id)}']/*:persName/text())}
Thanks!
Best,
Joey