Using ${answer} with xpath_eval

<oXygen/> general issues.
jtakeda
Posts: 7
Joined: Sat Feb 25, 2017 1:18 am

Using ${answer} with xpath_eval

Post by jtakeda » 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:

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

sorin_carbunaru
Site Admin
Posts: 228
Joined: Mon May 09, 2016 9:37 am

Re: Using ${answer} with xpath_eval

Post by sorin_carbunaru » Fri Feb 08, 2019 10:52 am

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

sorin_carbunaru
Site Admin
Posts: 228
Joined: Mon May 09, 2016 9:37 am

Re: Using ${answer} with xpath_eval

Post by sorin_carbunaru » Thu May 23, 2019 2:41 pm

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

Post Reply