As David suggests, I suspect you are displaying the result using xsl:value-of. In XSLT 1.0 (or 2.0 with backwards compatibility enabled) this only displays the first node in the selected node-set, in 2.0 it displays all of them. If you only want the first, use <xsl:value-of select="(EXPR)[1]"/> (or select backwards compatibility using [xsl:]version="1.0").
Michael Kay

From: Todd Gochenour []
Sent: 16 April 2009 20:50
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: Re: [saxon] XPath result different between XALAN and SAXON

Misspoke the problem.
Tested the scenario above and I'm getting 2 results for XALAN as well.
Actual problem:  The data I'm using is:
<command label="one">one</command>
<command label="two">two</command>
<command label="three">three</command>
<command label="four">four</command>
<command label="five">five</command>
and the XPath I'm using is: //command[1]/@label
In XALAN, I get the result "one".  In SAXON I get the result "one four".
Yet with XALAN the count(//command[1]) is two.  So the extra step for the @label is where the two implementations diverge.
How do I get the first command in the document?