Spry

Remove duplicate rows

 Use the distinct() method to remove duplicate rows in a data set:
var dsPhotos = new Spry.Data.XMLDataSet("/photos.php?galleryid=2000", "/gallery/photos/photo");
...
dsPhotos.distinct(); // Remove all duplicate rows.

In this context, the term duplicate row applies to a situation in which every column in the data set contains identical information in 2 or more rows.

To run the distinct() method automatically whenever data is loaded into a data set, use the distinctOnLoad option to the constructor.

var dsPhotos = new Spry.Data.XMLDataSet("/photos.php?galleryid=2000", "/gallery/photos/photo", { distinctOnLoad: true });

The distinct() method is destructive, so it discards any nondistinct rows. The only way to get the data back is to reload the XML data.