Page 1 of 1

Using ${answer} with xpath_eval

Posted: Fri Feb 08, 2019 4:36 am
by jtakeda
Hi there,

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)}">
Which works perfectly well. However, when I try to use that value within an xpath_eval, it fails:

Code: Select all

${xpath_eval(doc('${people}')//*:person[@xml:id='${answer(@user_id)}']/*:persName/text())}
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

Re: Using ${answer} with xpath_eval

Posted: Fri Feb 08, 2019 10:52 am
by sorin_carbunaru
Hello Joey,

Unfortunately there seems to be a bug in oXygen when using ${xpath_eval} in templates. I created a new issue on our side (EXM-42892 - for reference purposes), and we will update this thread when a fix will be available.

All the best wishes,
Sorin Carbunaru
oXygen XML

Re: Using ${answer} with xpath_eval

Posted: Thu May 23, 2019 2:41 pm
by sorin_carbunaru
Hello,

oXygen 21.1 has just been released a few hours ago, and it contains a fix for the problem you reported.

Best wishes,
Sorin Carbunaru
oXygen XML