Here is my XML:

<rows>
<row>
<title>Title 1</title>
<descriptions>
<description lang="EN">Lorem ipsum</description>
<description lang="FR">Lorem ipsum</description>
</descriptions>
</row>
<row>
<title>Title 2</title>
<descriptions>
<description lang="EN">Lorem ipsum</description>
<description lang="FR">Lorem ipsum</description>
</descriptions>
</row>
</rows>

What I need is to export @lang and the description as a string. (ex. "EN :: Lorem ipsum") So I used the concat function for the xpath:
description = concat(.//description,' :: ',.//@lang)
This works well for the first description but ignores the second.

Can anyone tell what I did wrong, please?

Comments

manicato’s picture

Issue summary: View changes
twistor’s picture

Category: Bug report » Support request
Status: Active » Fixed
Issue tags: -xpath, -concat
manicato’s picture

string-join is only available with xpath 2.0 which is not supported by Feeds XPath Parser

manicato’s picture

Status: Fixed » Active
twistor’s picture

Status: Active » Fixed

Why did you re-open this?

manicato’s picture

Because the solution you suggested doesn't work. The function string-join is only available for Xpath 2.0, which is not supported by Feeds XPath Parser.

twistor’s picture

That was an explanation, not a solution. There's nothing we can do about it. libxml doesn't support XPath 2.0. You can try using Feeds Tamper to do this.

manicato’s picture

Status: Fixed » Closed (won't fix)

So, don't mark it as fixed.

kenorb’s picture

This worked for me:

concat(title, ".", description)