Community Documentation

How to use variables in Xpath Parser Settings

Last updated December 26, 2012. Created by dawnbuie on December 26, 2012.
Log in to edit this page.

You might be confused - as I was - about how to use the replacement variables that are offered to you on the Settings for your XPath XML parser page.

You need to put quotes around the variables in order to have them processed.

For instance my last field on this page offers:

The XPath query to run.
The variables $guid, $path_alias, $nid, $title, $field_file, $body, $created are availliable for replacement.

Since I needed the $path value and not the $path with the tags around it, I added the following to my text field:

"http://www.mysite.com$path_alias"

Note, if you are having too much trouble making this work - you can also use REGEX to modify your field, if you've set up the Feeds Tamper module.

Site Building Guide

Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.