[ https://issues.apache.org/jira/browse/XALANJ-2524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12924156#action_12924156 ]
Mukul Gandhi commented on XALANJ-2524: -------------------------------------- Trying to reproduce the problem you've posted. Here is another example please: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exslt="http://exslt.org/common" version="1.0"> <xsl:output method="text" /> <xsl:template match="/"> <xsl:variable name="rtf"> <root> <x>1</x> <x>2</x> <x>3</x> </root> </xsl:variable> <xsl:call-template name="foo"> <xsl:with-param name="nodeList" select="exslt:node-set($rtf)/root/x" /> <xsl:with-param name="idx" select="1" /> </xsl:call-template> </xsl:template> <xsl:template name="foo"> <xsl:param name="nodeList" /> <xsl:param name="idx" /> Length of node-list: <xsl:value-of select="count($nodeList)" /> $nodeList[2]: <xsl:value-of select="$nodeList[2]" /> <xsl:if test="$idx < count($nodeList)"> <xsl:call-template name="foo"> <xsl:with-param name="nodeList" select="$nodeList" /> <xsl:with-param name="idx" select="$idx + 1" /> </xsl:call-template> </xsl:if> </xsl:template> </xsl:stylesheet> This produces following output with Xalan-J 2.7.1: Length of node-list: 3 $nodeList[2]: 2 Length of node-list: 3 $nodeList[2]: 2 Length of node-list: 3 $nodeList[2]: 2 This looks correct to me (each recursive step produces the right output). Did you intend to do something like this? As of now I'm hesitant to confirm from my side whether the observation you've shared is really a bug with Xalan's node-set method implementation. I seem to find Xalan's node-set function implementation, RTF processing and recursion implementations reasonably correct. Are you trying to solve a particular problem with Xalan-J? May be we can try to find a solution with Xalan-J (with an existing implementation) for a specific use-case. > applying exslt:node-set to a node set yields something that is not a node set > ----------------------------------------------------------------------------- > > Key: XALANJ-2524 > URL: https://issues.apache.org/jira/browse/XALANJ-2524 > Project: XalanJ2 > Issue Type: Bug > Security Level: No security risk; visible to anyone(Ordinary problems in > Xalan projects. Anybody can view the issue.) > Components: Xalan-extensions > Affects Versions: 2.7.1 > Reporter: Julian Reschke > Priority: Minor > Attachments: patch_xalanj-2524.txt > > > Applying the exslt:node-set extension to something that already is a node set > yields a non-node set result. > This is a bug according to > <http://exslt.org/exsl/functions/node-set/exsl.node-set.html>: > "If the argument is a node-set already, it is simply returned as is." > Test case: > <?xml version="1.0" encoding="UTF-8"?> > <xsl:stylesheet version="1.0" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:exslt="http://exslt.org/common" > > > <xsl:output method="text"/> > <xsl:template match="/"> > > <xsl:variable name="t"> > <root> > <x>1</x> > <x>2</x> > <x>3</x> > </root> > </xsl:variable> > <xsl:variable name="tns1" select="exslt:node-set($t)/root/x"/> > <xsl:variable name="tns2" select="exslt:node-set($tns1)"/> > > Type of t: <xsl:value-of select="exslt:object-type($t)"/> > Type of tns1: <xsl:value-of select="exslt:object-type($tns1)"/> > Name of tns2: <xsl:value-of select="exslt:object-type($tns2)"/> > > </xsl:template> > </xsl:stylesheet> > This yields the expected result in xsltproc, Saxon 6.* and XSLTC, but not in > Xalan-J. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: xalan-dev-unsubscr...@xml.apache.org For additional commands, e-mail: xalan-dev-h...@xml.apache.org