Pulling Link/href

Closed

Import WP Updated 2 weeks ago 5 Replies

Ron asked 2 weeks ago on February 4, 2025 at 8:50 pm

Hi,

I’m testing out your importer. The xml feed unfortunately doesn’t include the link and image in their own nodes. So when I pull the image link, it also pulls the article link. Which breaks the featured image. The image link does have a rel tag (rel=”enclosure”). Is there a combination to pull only the link value that is an image?

The product seems very flexible, but I couldn’t commit to purchasing the pro version if there isn’t a way differenciate the two link tags. Unfortunately, I have no control over the format of the XML.

Thank you.

-Ron

J

James replied Support Agent

2 weeks ago on February 4, 2025 at 9:02 pm

Hi Ron,

Are you able to share a sample of the xml file?

You should be able to target specific parts of the xml file using xpath, e.g. something to fetch the href of an a tag with rel="enclosure":

/a[@rel="enclosure"]/@href

James

RP

Ron replied

2 weeks ago on February 4, 2025 at 9:16 pm

Hi James,

The node it is picking up is /link/@href. I tried the square bracket, but the preview didn't pull the information.

https://www.wvgazettemail.com/search/?c%5B%5D=live*&t=video%2Cyoutube&s=start_time&sd=desc&l=100&nsa=eedition&q=echo+chamber&f=atom&emb=true

-Ron

RP

Ron replied

2 weeks ago on February 4, 2025 at 9:17 pm

Hi James,

The URL was truncated. Here's the downloaded file.

-Ron

J

James replied Support Agent

2 weeks ago on February 4, 2025 at 9:24 pm

Thanks, from your xml setting the base path to /feed/entry

Then you can get the image url:

{/link[@rel="enclosure"]/@href}

James

RP

Ron replied

2 weeks ago on February 5, 2025 at 9:00 pm

Hi James,

Thank you.

-Ron