Drupal 7:使用feed可扩展解析器解析xml



大家好。

我有这样一个xml文件:

<categories>
    <category id="1">Cat. 1</category>
    <category id="2">Cat. 2</category>
</categories>

我所需要的就是将category作为术语导入到我的词汇表中。但是我不知道该怎么做。我的问题是,我不能正确配置进口商。下一件事不工作,因为标题将是空的:

context: //categories/*
id: @id
title: category 

如果我走另一条路

context: /categories
title: category
id: category/@id

我将收到两个数组:标题,id。由于数据类型(数组),不会添加任何分类法术语。所以我不能拆分数组得到1 (title,id) => 1 new term

看一下Feeds Tamper模块,它使您能够在Feeds导入数据之前对数据进行更改。

答案在这里https://www.drupal.org/node/2542928评论- 10178930

背景:/类别/类别

标题:text ()

id: @ id

Thanks to twistor from drupal.org

最新更新