Map XML feeds on some basic conditions without using feeds tamper module
First, take a look at an example
<images>
<image type="file">https://s3.amazon.com/example1.pdf</image>
<image type="file">https://s3.amazon.com/example3.pdf</image>
<image type="file">https://s3.amazon.com/example2.pdf</image>
<image type="image">https://s3.amazon.com/example.jpg</image>
</images>
Case 1: If you want to import only those feeds that has type "image" then your XML Parser settings should be like Images/Image[./@type = 'image']
Case 2: Import feeds that has not file type then Images/Image[./@type != 'file']
Under XPath XML parser settings we have this set as an query to retrieve those images
Reference Site: https://www.drupal.org/node/1108220
First, take a look at an example
<images>
<image type="file">https://s3.amazon.com/example1.pdf</image>
<image type="file">https://s3.amazon.com/example3.pdf</image>
<image type="file">https://s3.amazon.com/example2.pdf</image>
<image type="image">https://s3.amazon.com/example.jpg</image>
</images>
Case 1: If you want to import only those feeds that has type "image" then your XML Parser settings should be like Images/Image[./@type = 'image']
Example 2:
<item>
<enclosure url="http://www.example.com/path-to-image/image1.jpg" type="image/jpeg"/>
<enclosure url="http://www.example.com/path-to-image/image2.jpg" type="image/jpeg"/>
<enclosure url="http://www.example.com/path-to-image/image3.jpg" type="image/jpeg"/>
<title>Demo title 1</title>
</item>
Under XPath XML parser settings we have this set as an query to retrieve those images
field_feed_image: enclosure[1]/@url
field_feed_image: enclosure[2]/@url
field_feed_image: enclosure[3]/@url
Reference Site: https://www.drupal.org/node/1108220
Comments
Post a Comment