Strange Behaviour With <xsl:copy-of>
Added by Anonymous about 20 years ago
Legacy ID: #2861093 Legacy Poster: Johnny Ooi (jjyooi)
I've got this code: <xsl:variable name="temp"> <xsl:call-template name="sometemplate"> <xsl:with-param name="arg" select="$tree"/> </xsl:call-template> <xsl:copy-of select="$var"/> </xsl:variable> Now, if instead of the above, I do the call-template and the copy-of $var individually, I get the correct output (basically, both return a tree). However, in the above, doing <xsl:copy-of select="$var"/> returns a tree, with the $var contents before the call-template, no matter which way around I put the copy-of and the call-template. I am using SAXON 8.1.1 from Saxonica and Java 1.5.0 (the latest). Any ideas? Or is it a bug? Johnny
Replies (4)
Please register to reply
RE: Strange Behaviour With <xsl:copy-of> - Added by Anonymous about 20 years ago
Legacy ID: #2861121 Legacy Poster: Johnny Ooi (jjyooi)
sorry, I meant that doing copy-of $temp returns the misordered contents. Also, $var is also the result of a template call which I did earlier, if that helps.
RE: Strange Behaviour With <xsl:copy-of> - Added by Anonymous about 20 years ago
Legacy ID: #2861267 Legacy Poster: Michael Kay (mhkay)
Could you please put together a complete example - as simple as possible - that illustrates the problem (i.e. a source document and stylesheet)? Without that, it's very difficult to investigate. Michael Kay
RE: Strange Behaviour With <xsl:copy-of> - Added by Anonymous about 20 years ago
Legacy ID: #2861953 Legacy Poster: Johnny Ooi (jjyooi)
Hi, Michael, thanks for replying. You won't need to worry about this issue any longer, I found the problem and it was nothing to do with your parser, another template I wrote was misbehaving doing to a rogue data node in my XML tree and it was causing it to traverse down the wrong side of the tree first. Problem Solved Regards Johnny Ooi
RE: Strange Behaviour With <xsl:copy-of> - Added by Anonymous about 20 years ago
Legacy ID: #2862018 Legacy Poster: Michael Kay (mhkay)
No problem. I thought it was probably a user error. MK
Please register to reply