When I use the option "Select the queries you would like to return raw XML or HTML", the tag included in the XPath query is returned in the result.

For instance, let's take the following example using this XML -

<top>
  <item>
    <title>Title</title>
    <body><p>Body</p></body>
  </item>
</top>

When choosing the option above, I can use the following XPath settings and set body to return raw HTML -

context: //item
title: title
body: body

The output of the mapped body field is <body><p>Body</p></body> rather than <p>Body</p>. Is this the correct behavior?

Comments

twistor’s picture

Component: User interface » Documentation
Assigned: Unassigned » mitchell
Category: bug » support

This is the correct behavior. To get your desired result try body/*.

erikwebb’s picture

Thanks, this should definitely be in the help text. I don't believe this is standard XPath behavior.

upupax’s picture

Same problem for me with the 7.x-1.0-beta2 release.

context: //item
title: title
body: body

output: <title>title</title>

context: //item
title: title/*
body: body/*

output: nothing.
I don't think this is the standard behavior.

upupax’s picture

SHAME ON ME!!
I've confused Debug options with Return raw XML.
So sorry. :(

texas-bronius’s picture

Status: Active » Closed (works as designed)

Thanks for posting-- it helped me out. To be clear to anyone else: Debug options intentionally stuff the tag, element, or attribute name into the resultant value of the xpath query. Use the regular xpath you know, not the /* examples above-- just be sure to uncheck Debug on the actual fields captured.