Hello
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"?>
<cdcatalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
<cd>
<title>Hide your heart</title>
<artist>Bonnie Tyler</artist>
<country>UK</country>
<company>CBS Records</company>
<price>9.90</price>
<year>1988</year>
</cd>
.
.
.
.
.
</cdcatalog>
|