Syntax for filtering on No node attributes
This is an open discussion with 2 replies, filed under XSLT.
Search
Try
<xsl:template match="last-fm/lfm/recenttracks/track[not(@nowplaying)]">
Ok cool, I'll try this out in a bit.. why doesn't spotify give you user data eh! scrobbling from spottify to lastfm to pick up user data :)
Where's the best resource for grasping syntax like this? w3schools site?
Create an account or sign in to comment.
Hey ho, been pulling lastfm data into a test site and am grabbing last 5 tracks recently played.. in the XML there is a node TRACK which all retruned tracks seem to have on them. But there's one bloody track entry that has an attribute of nowplaying="true" which I've managed to separate out in a template match to isolate itself.. but it's still in the main template match :
<xsl:template match="last-fm/lfm/recenttracks/track[@nowplaying = 'true']">
what I want to do is exclude this node that has an attribute of nowplaying from the other matched list.. but I'm not sure what syntax I should be using to separate it out? anyone?I thought something like
<xsl:template match="last-fm/lfm/recenttracks/track[@nowplaying = 'false']">
would work.. but there is no attribute of "nowplaying" on any other track bar the first entry so can't filter on the false element.