'Use XPATH to Isolate a Child Image
I'm running a Ruby script that isolates and extracts datapoints/nodes from a Wordpress export file. (XML)
I'm having success with basic XPATH for these nodes:
#grab content from source item
title = item.xpath("./title/text()").to_s
description = item.xpath("./description/text()").to_s
main_content = item.xpath("./content:encoded/node()").text
author = item.xpath("./dc:creator/text()").to_s
However, I'm having difficulty extracting the IMAGE filename/url from my XML.
The image url is always contained inside this node: <wp:meta_value>
How can I write an XPATH command to isolate the full url and/or filename of the jpg child of that node?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|