[xsl] sorting and 0 div boolean

Subject: [xsl] sorting and 0 div boolean
From: "Susan Campbell" <SCampbell@xxxxxxxxxxxxxxx>
Date: Tue, 14 Feb 2006 13:24:06 -0500
This code worked but now it doesn't work.   We had a software upgrade
and our processor is contained within the other software.  When the sort
worked we were using Saxon 6.4.2.  We're now using Saxon 7.7.  This code
still works in the old version, but not in the new.  This code now
returns a parse error, "Division by zero."  I read the FAQ about
'Division by zero' but format-number doesn't help me here.

Is there another way to sort this and ignore the stop words I have here?
The problem section of my xsl is here, followed by a snippet of the xml
I'm trying to transform.
Susan Campbell

   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0"


<xsl:variable name="stop-words"
<xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'"/>
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUV'"/>

<xsl:template match="/">
<xsl:call-template name="header"/>
     <xsl:for-each select="//section-02/title">
     <xsl:sort select="concat(substring(substring-after(.,' '), 0 div
             ($stop-words[starts-with(translate(current(), $uppercase,
             concat(translate(., $uppercase, $lowercase), ' '))])),
substring(., 0 div not
             ($stop-words[starts-with(translate(current(), $uppercase,
             concat(translate(., $uppercase, $lowercase), ' '))])))"/>
          <xsl:if test="position() = 1">
          <xsl:call-template name="section-02">
             <xsl:with-param name="header" select="'header'"/>
       <xsl:call-template name="section-02"/>

The XML section I'm trying to sort looks like this;.
<title>The African American review.</title>

<title>Agricultural research /</title>

<title>The American biology teacher.</title>

<title>The American journal of nursing.</title>

<title>Air &amp; space Smithsonian.</title>

<title>An American Story.</title>

Current Thread