Search

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.

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.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details