There's not enough information here to see where you are going wrong.
The use of not(X = preceding::X) is typically a very inefficient way of removing duplicates, though it can be viable on small documents. In XSLT 2.0 use for-each-group; in 1.0 use Muenchian grouping with keys (see
www.jenitennison.com/xslt/grouping)
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference