[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] how with xPath 1

Subject: [xsl] how with xPath 1
From: Leo Studer <leo.studer@xxxxxxxxxxx>
Date: Sat, 14 Apr 2012 09:05:24 +0200


in xPath 2.0 I retrieve the newest CDs for each artist like that

for $i in distinct-values(//artist) return (//cd[artist eq $i and year=
max(//cd[artist eq $i ]/year)])

How can I do that with xPath 1?

Here a snippet of the xml file

<?xml version="1.0" encoding="ISO-8859-1"?>
      <title>Empire Burlesque</title>
      <artist>Bob Dylan</artist>
      <title>Hide your heart</title>
      <artist>Bonnie Tyler</artist>
      <company>CBS Records</company>

Current Thread