Say I have this

Node Field xpath query

title title
body $title

Shouldn't both title and body be the same? Right now the second field is still empty when I use the variable from the first field as input.

Comments

eaj’s picture

I just chased down the same problem. Since you're using the dev version, this ought to work for the value of the body field:

string("$title")

Not exactly intuitive to me, but then I'm not really that familiar with xpath either. Perhaps it's obvious to those in the know.

twistor’s picture

Component: Code » Documentation
Assigned: Unassigned » twistor

As a clarification, $variable substitution, substitutes the value from another XPath query into another XPath query.

For instance:

<feed>
  <entry>
    <title>kitten</title>
    <link kitten="http://example.org/"/>
  </entry>
</feed>

To get the value of the albino attribute , you could do:
context: //entry
title: title
link: link/@$title

link would becom:
link: link/@kitten

This needs further documentation.

zazinteractive’s picture

So you can't just use variables directly like I did in the original post?

twistor’s picture

You can use them that way, but they won't be the same. The value that the XPath query "title" returns will be used as the XPath query for body.

twistor’s picture

Assigned: twistor » Unassigned
Status: Active » Closed (works as designed)