Re: [xsl] RuntimeException : Programmers's assertion from xsl transform

Subject: Re: [xsl] RuntimeException : Programmers's assertion from xsl transform
From: "Simon Kelly" <kelly@xxxxxxxxxx>
Date: Fri, 4 Jul 2003 14:25:09 +0200
I'm having a struggle to pin point the run-time error with this.

I have narrowed it down to in being caused by a test="" statement, with a
quick search of the net. But I cannot see any problem with any of my test
statements.

Could someone see if they can spot the bloomer!

test="$image-node-list"
-- Requires a return of true if list is not null.

test="not($image-node-list)"
-- Require a return of true if list is null

test="($finish - $start) = $images-across"
test="$start = $finish"
test="$start < $finish"
-- Obvious returns, all values are numbers.

test="$image-node-list[$start]/link"
-- Requires true if link node exists

test="$image-node-list[$start][position() = last()]"
-- Require true if the node at position $start is the last node in node set

As always, all help greatfully recieved.

Cheers

Simon







----- Original Message -----
From: "Simon Kelly" <kelly@xxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Friday, July 04, 2003 11:43 AM
Subject: [xsl] RuntimeException : Programmers's assertion from xsl transform


> Hi all,
>
> I am getting a run time error from an xsl transform, but I don't have a
clue
> what this means. Any help would be greatfully recieved. I've included part
> of the code where I think the problem may lie.
>
> "java.lang.RuntimeException: Programmer's assertion in getNextStepPos:
> unknown stepType: -1"
>
> Cheers
>
> Simon
>
> [code]
>     <xsl:template name="image-layout-left-to-right">
>         <xsl:param name="image-node-list" select="/.." />
>         <xsl:param name="images-across" select="2" />
>         <xsl:param name="start" select="1" />
>         <xsl:param name="finish" select="$start + $images-across" />
>
>         <xsl:variable name="row-start" select="&lt;tr&gt;" />
>         <xsl:variable name="row-end" select="&lt;/tr&gt;" />
>
>         <xsl:choose>
>             <xsl:when test="$image-node-list">
>                 <xsl:if test="($finish - $start) = $images-across">
>                     <xsl:value-of select="$row-start" />
>                 </xsl:if>
>                 <xsl:if test="$start = $finish">
>                     <xsl:value-of select="$row-end" />
>                 </xsl:if>
>                 <xsl:if test="$start &lt; $finish">
>                     <!-- Process the node at position() = $start -->
>                     <td>
>                         <xsl:if test="not($image-node-list[$start]/link)">
>                             <a href="{$image-node-list[$start]/link}">
>                         </xsl:if>
>                             <img src="{$image-node-list[$start]/src"
>                                  alt="{$image-node-list[$start]/alt"
>                                  height="{$image-node-list[$start]/height"
>                                  width="{$image-node-list[$start]/width"
>                                  align="{$image-node-list[$start]/align"/>
>                         <xsl:if test="not($image-node-list[$start]/link)">
>                             </a>
>                         </xsl:if>
>                     </td>
>                 </xsl:if>
>
>                 <!-- Call the template again reajusting the required
> parameters -->
>                 <xsl:call-template name="image-layout-left-to-right">
>                     <xsl:with-param name="image-node-list">
>                         <xsl:choose>
>                             <xsl:when
> test="$image-node-list[$start][position()] = last()">
>                                 <xsl:value-of select="/.." />
>                             </xsl:when>
>                             <xsl:otherwise>
>                                 <xsl:value-of select="$image-node-list" />
>                             </xsl:otherwise>
>                         </xsl:choose>
>                     </xsl:with-param>
>                     <xsl:with-param name="images-across"
> select="$images-across" />
>                     <xsl:with-param name="start" select="$start + 1" />
>                     <xsl:with-param name="finish">
>                         <xsl:choose>
>                             <xsl:when test="$start = $finish">
>                                 <xsl:value-of select="$finish +
> $images-across" />
>                             </xsl:when>
>                             <xsl:otherwise>
>                                 <xsl:value-of select="$finish" />
>                             </xsl:otherwise>
>                         </xsl:choose>
>                     </xsl:with-param>
>                 </xsl:call-template>
>             </xsl:when>
>             <xsl:otherwise>
>                 <!-- Code to write packing cells -->
>             </xsl:otherwise>
>         </xsl:choose>
>     </xsl:template>
> [/code]
>
> "I have often wondered how it is that every man loves himself more than
all
> the rest of men, but yet sets less value on his own opinion of himself
than
> on the opinion of others." -- Georg Christoph Lichtenberg
>
> Institut fuer
> Prozessdatenverarbeitung
> und Elektronik,
> Forschungszentrum Karlsruhe GmbH,
> Postfach 3640,
> D-76021 Karlsruhe,
> Germany.
>
> Tel: (+49)/7247 82-4042
> E-mail : kelly@xxxxxxxxxx
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread