[xsl] JDK 1.4 <> 5.0 transformation compatibility

Subject: [xsl] JDK 1.4 <> 5.0 transformation compatibility
From: Kai Hackemesser <kaha@xxxxxx>
Date: Fri, 15 Jun 2007 09:14:21 +0200
Hello!

I have the strange case that a xsl transformation (XSL 1.0) output looks different between an application running in JDK1.4.2 and JDK 1.5.0. In fact there is a part of the output html structure missing. I'm not sure what caused that. I'm using the original JDK translation engine in both cases and there is nothing like scripting or extensions in the xsl, just some grouping using xsl-key and generate-id. Does anybody what incompatibilites exist between the JDK versions?

   <xsl:key name="IRNCategory" match="IR/N" use="concat(generate-id(..) , string(Category))"/>
(...)
                   <xsl:variable name="currentIR" select="."/>
                   <xsl:variable name="categories"
                       select="N[generate-id(.)= generate-id(key('IRNCategory', concat(generate-id(.) , string(Category)))[1])]/Category"/>
                   <xsl:for-each select="$categories">
                       <xsl:variable name="category" select="."/>
                       <xsl:call-template name="nCategory"/><!-- This is still displayed in both JDKs -->
                       <xsl:variable name="n"
                           select="$currentIR/N[Category = $category]"/>
                       <xsl:call-template name="handleN"><!-- the output of this template is missing-->
                           <xsl:with-param name="n" select="$n"/>
                       </xsl:call-template>
                   </xsl:for-each>
<!-- template is from other xsl included -->
   <xsl:template name="handleN">
       <xsl:param name="n"/>
               <tr>
                   <td colspan="2">
                       <xsl:for-each select="$n">
                           <xsl:sort select="Year" data-type="number" order="descending"/>
                           <xsl:sort select="Number" data-type="number" order="descending"/>
                           <xsl:apply-templates select="."/>
                       </xsl:for-each>
                   </td>
               </tr>
   </xsl:template>
<!-- Template for N just holds an output of N as html table without any relevant logic-->

Kind regards,
Kai

Current Thread