Hi, thanks for the very useful module. Im using Views Data Export module to generate a XML page with content from one site and then using Feeds Xpath Parser on another site to import the content. Everything works perfectly with the exception of multivalue entity reference fields in my XML feed. When I debug the context the only thing returned is the trailing tag form the field. Heres an example of my XML which all seems perfectly valid so I cant workout why XPath Parser would be having trouble reading it.

<?xml version="1.0" encoding="UTF-8" ?>
<nodes>
  <node>
      <nodetitle>MY NODE TITLE</nodetitle>
        <uuid>0f84fa17-21b0-18a4-851b-43182c4f65f1</uuid>
        <standards>WRSTC</standards>
    </node>
  <node>
      <nodetitle>ANOTHER NODE TITLE</nodetitle>
        <uuid>163151ca-54dc-6524-bdcg-25e258bf352a</uuid>
        <standards>
          <item>ISO</item>
          <item>WRSTC</item>
        </standards>
    </node>
</nodes>

And the context I get in the Feeds Xpath Parser is...

<node> <nodetitle>MY NODE TITLE</nodetitle> <uuid>0f84fa17-21b0-18a4-851b-43182c4f65f1</uuid> <standards/> </node>
<node> <nodetitle>ANOTHER NODE TITLE</nodetitle> <uuid>163151ca-54dc-6524-bdcg-25e258bf352a</uuid> <standards/> </node>

Im not really sure where this error is coming from, but as far as I can see my output XML seems perfectly valid so I dont understand why my context is missing elements. Has anyone else had similar issues like this or got any suggestions why this might be happening.

Thanks

Comments

twistor’s picture

Status: Active » Postponed (maintainer needs more info)

I cannot reproduce this. What version of PHP are you using?

core44’s picture

php 5.2.17

Im currently using a very ugly workaround involving adding new computed fields for every entity reference field on my site. The computed field duplicates the reference titles as comma separated values. Then adding those fields to my views data export views instead.

I tried to use a views php field to just output the titles of the entity reference fields using php but I had the same problem. The xml looked perfect with all my values in the right tags, but xpath parser returned and empty context for the field.

When you say you cant reproduce the problem, I assume you're saying you can output multivalue fields (entity reference or any) in a views data export XML, and retrieve all the values in the context of feeds xpath parser on another site? If so can you please tell me what versions of relevant modules you are using, xpath parser, views data export, views.

thank you.

apmsooner’s picture

I ran into something similar with multi-value images. just output the entity reference field without rewrite as multivalued separated by commas. I'm not a hundred percent sure of the display formatters for the entity reference field available but i would assume plain text should be chosen as the option so you'd have something like this:
<standards>ISO,WRSTC</standards>

assuming context //node

for the feed side:
The xpath should be: standards
Configure feeds tamper on that field to explode the values using a comma as the separator

It should work this way for you. I tried something similar on the image side of things with a file relationship to rewrite the images field to the raw file path and it duplicated the first file 2 more times which wasn't what i wanted. So, i reverted to just using the image field itself but displayed as rendered file as 'link' which is one of the file display options. for my case i had to configure that file display here: /admin/config/media/file-types/manage/image/file-display/media_link with url to file checked. For your case, you may just need to specify plain text in the view and should be good.

core44’s picture

Thank you for the advice. Ill give it a go and report back if it fixes my problem.

core44’s picture

Unfortunately that doesn't seem work in my instance, it just returns the first delta value rather than a comma separated list. Thanks anyway. Keen to find out if anyone else has managed to render multivalue fields as comma separated lists?

twistor’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Closing out old issues. I doubt that this has anything to do with Feeds XPath Parser.

If you're still having this issue, feel free to re-open.