Strange Behaviour With <xsl:copy-of>

Johnny Ooi
  • Johnny Ooi

    Johnny Ooi - 2004-11-20

    I've got this code:

    <xsl:variable name="temp">
    <xsl:call-template name="sometemplate">
    <xsl:with-param name="arg" select="$tree"/>
    <xsl:copy-of select="$var"/>

    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?


    • Michael Kay

      Michael Kay - 2004-11-20

      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

    • Johnny Ooi

      Johnny Ooi - 2004-11-20

      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.

    • Johnny Ooi

      Johnny Ooi - 2004-11-21

      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


      Johnny Ooi

      • Michael Kay

        Michael Kay - 2004-11-21

        No problem. I thought it was probably a user error.



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks