Target tweet image in atom feed.
This is an open discussion with 7 replies, filed under XSLT.
Search
Can you post your full xsl?
You probably want to target the link based on the rel
attribute, so something like this:
<img src="{atom:link[@rel = 'image']/@href}"/>
That's the ticket! cheers czheng!
How does it work if the size attribute is the last bit in the node?
i.e album/track/image is my node tree.. but there are 4 images with attributes of
<image size="small" /> <image size="medium" /> <image size="large" /> <image size="extralarge" />
And I tried this <img src="{image/[@size = 'medium']}" />
but I get an error that it's an invalid expression..
It's cool, I just used the count to get to the medium image <img src="{image[2]}"/>
This should work:
<img src="{image[@size = 'medium']}" />
Ahh I see.. without the / in the syntax. Cheers Nils. the count thing works as well.. just nice to know where I was going wrong on the code side.
Create an account or sign in to comment.
Ho do you get to an image/user profile pic in an atom feed from twitter?
If have this, but I noticed there are 2 link types.. html and image/png.
But the feeds link node is written like this:
<link type="image/png" href="image.png" rel="image"/>
So just wondering what syntax is best to target the href part of this node if there is another link type in the entry with html as it's type:
<link type="text/html" href="link.com" rel="alternate"/>
Any pointers?