Hi,

I'm wondering if this code could be improved or if saxonee generally speaking would optimize this code to a large extent.

Also to utilize the optimizations from a java application using saxon9EE is there code or settings that would need to be written that would be different from a java application written using saxon9HE?

<xsl:template name="CategorizeAndgroupLines">
      <xsl:for-each-group select="line" group-adjacent="if (not(xs:boolean(@z_isFuzCD3))) then 1
         else if (xs:boolean(@z_isFuzCD3)) then 2
         else 0">
         <xsl:choose>
            <xsl:when test="current-grouping-key() = 1 and count(current-group()) ge 3">
               <xsl:element name="Paragraphs">
                  <xsl:attribute name="numberLine" select="count(current-group())"/>
                  <xsl:copy-of select="current-group()"/>
               </xsl:element>
            </xsl:when>
            <xsl:when test="current-grouping-key() = 1 and count(current-group()) lt 3">
               <xsl:element name="NonColumnData">
                  <xsl:attribute name="numberLine" select="count(current-group())"/>
                  <xsl:copy-of select="current-group()"/>
               </xsl:element>
            </xsl:when>
            <xsl:when test="current-grouping-key() = 2">
               <xsl:element name="LikelyColumnData">
                  <xsl:attribute name="numberLine" select="count(current-group())"/>
                  <xsl:copy-of select="current-group()"/>
               </xsl:element>
            </xsl:when>
            <xsl:otherwise>
               <Error>
                  <xsl:copy>
                     <xsl:copy-of select="@*"/>
                     <xsl:apply-templates/>
                  </xsl:copy>
               </Error>
            </xsl:otherwise>
         </xsl:choose>
      </xsl:for-each-group>
     
   </xsl:template>

Regards
--
Alex Muir
Instructor | Program Organizer - University Technology Student Work Experience Building
University of the Gambia

http://sites.utg.edu.gm/alex/

Low budget software development benefiting development in the Gambia, West Africa
Experience of a lifetime, come to Gambia and Join UTSWEB - http://sites.utg.edu.gm/utsweb/