xsl-list
[Top] [All Lists]

[xsl] how with xPath 1

2012-04-14 02:05:43
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>


 
--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--