I’m having trouble figuring out why the following transform works as I expected it to in Saxon invoked by JAXP, and from the Saxon.net command line, but produces different results when invoked from an Asp.net application:


Here’s the xslt in question – the url is http://www2.turffiles.ncsu.edu/ContentManagement/CMXml/TestTransform.xsl


   <xsl:template match="PropertyGroupSet">


                <xsl:variable name="fieldNames">                                             

                                <xsl:value-of select="Property/Name" separator=","></xsl:value-of>                                            



                <xsl:value-of select="$fieldNames"></xsl:value-of>


                        <xsl:when test="Property/IsSingleValueProperty=0">    



                                        <xsl:call-template name="multipleValues"/>


                                                <xsl:value-of select="@Name" />

                                                <img class="groupOptions" src="http://www.turffiles.ncsu.edu/images/fwd.gif" onclick="ShowPossibilities(event,{@PropertyID},true,'{$fieldNames}')" />                                             


                                        <xsl:call-template name="formItem"/>




                                <xsl:call-template name="formItem"/>

                                <img class="Options" src="http://www.turffiles.ncsu.edu/images/fwd.gif" onclick="ShowPossibilities(event,{Property/PropertyID},false,'{$fieldNames}')" />     





The source document is at http://www2.turffiles.ncsu.edu/ContentManagement/CMXml/TestProps.xml


The relevant section is the following PropertyGroupSet node with 2 name descendants:


<PropertyGroupSet Name="Author" PropertyID="17">




      <FriendlyName>Last Name</FriendlyName>









      <FriendlyName>First Name</FriendlyName>








I expect that the $fieldNames variable will select both Name nodes in this group; instead, it only selects the first of these.  More oddly still, the xpath expression count(Property/Name) correctly returns the value 2 here.  Property/Name[2] returns ‘FirstName’, as I expect it to.  Is there an error in my xslt that I’m not seeing?  Or is this an issue in Saxon.Net?  As I said, this works fine from the command line for both Saxon and Saxon.net, and invoked by jaxp in java.


On a somewhat related issue: I also had trouble with a couple of other xpath functions: node-name() and distinct-values() both seemed to choke the saxon.net processor, at least when I tried them.



Joe Levine