Select a specific RSS attribute using SXL

I have an RSS feed that contains this

<abc:artimg height="53">http://www.apple.com/53-a.jpg</abc:artimg>
<abc:artimg height="60">http://www.apple.com/60-a.jpg</abc:artimg>
<abc:artimg height="100">http://www.apple.com/100-a.jpg</abc:artimg>

I want to display only the image URL with height=100, how do I do that?
LVL 1
winstein2005Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SteveH_UKCommented:
Make sure the relevant namespaces are defined in the stylesheet, then use this:

<xsl:template match="artimg[@height='100']">
...
</xsl:template>

The square brackets introduce a constraint on matching.  The @height is the height attribute of matched nodes and the ='100' compares the height attribute to 100.

Let me know if you need more help with this.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Geert BormansInformation ArchitectCommented:
In the templaet of the parent of all these images do
<xsl:copy-of select="abc:artimg[@height = '100']"/>

somewhere in your source XML you will have an attribute like this
xmlns:abc="..." with ... a string value
copy that entire attribute in the xsl:stylesheet element of your XSLT
(that is the declaration of the abc prefixed namespace)

cheers

Geert
0
SteveH_UKCommented:
Thanks for the points :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.