From: Joseph L. <jl...@cr...> - 2005-10-11 22:18:34
|
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: =20 Here's the xslt in question - the url is http://www2.turffiles.ncsu.edu/ContentManagement/CMXml/TestTransform.xsl =20 <xsl:template match=3D"PropertyGroupSet"> =20 <xsl:variable name=3D"fieldNames"> <xsl:value-of select=3D"Property/Name" separator=3D","></xsl:value-of> </xsl:variable> =20 <xsl:value-of select=3D"$fieldNames"></xsl:value-of> <xsl:choose> <xsl:when test=3D"Property/IsSingleValueProperty=3D0"> =20 <br></br> <fieldset> <xsl:call-template name=3D"multipleValues"/> <legend> <xsl:value-of select=3D"@Name" /> <img class=3D"groupOptions" = src=3D"http://www.turffiles.ncsu.edu/images/fwd.gif" onclick=3D"ShowPossibilities(event,{@PropertyID},true,'{$fieldNames}')" = /> </legend> <xsl:call-template name=3D"formItem"/> </fieldset> </xsl:when> <xsl:otherwise> <xsl:call-template name=3D"formItem"/> <img class=3D"Options" src=3D"http://www.turffiles.ncsu.edu/images/fwd.gif" onclick=3D"ShowPossibilities(event,{Property/PropertyID},false,'{$fieldNa= m es}')" /> =20 </xsl:otherwise> </xsl:choose> =20 </xsl:template> =20 The source document is at http://www2.turffiles.ncsu.edu/ContentManagement/CMXml/TestProps.xml =20 The relevant section is the following PropertyGroupSet node with 2 name descendants: =20 <PropertyGroupSet Name=3D"Author" PropertyID=3D"17"> <Property> <PropertyID>5</PropertyID> <Name>LastName</Name> <FriendlyName>Last Name</FriendlyName> <Type>String</Type> <IsUnique>false</IsUnique> <IsSingleValueProperty>0</IsSingleValueProperty> <PropertyGroupSet>Author</PropertyGroupSet> </Property> <Property> <PropertyID>6</PropertyID> <Name>FirstName</Name> <FriendlyName>First Name</FriendlyName> <Type>String</Type> <IsUnique>false</IsUnique> <IsSingleValueProperty>0</IsSingleValueProperty> <PropertyGroupSet>Author</PropertyGroupSet> </Property> </PropertyGroupSet> =20 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. =20 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. =20 Thanks, Joe Levine =20 =20 |