Hi,
I hope someone looks at this. I have used the following, which works,
but still don't see why my original when block was giving such a wierd
error.
Mike
=============new functional choose
<xsl:choose>
<!-- handle with decimal place -->
<xsl:when test="$voffset != 0 or $hasdecimal != 0">
<xsl:value-of select="concat($vsgn,
substring-before($vmantisa, '.'), substring-after($vmantisa, '.'),
substring($max-exp, 1, ($vexponent - $voffset)))"/>
</xsl:when>
<!-- handle when no decimal -->
<xsl:otherwise>
<xsl:value-of select="concat($vsgn, $vmantisa,
substring($max-exp, 1, $vexponent))"/>
</xsl:otherwise>
</xsl:choose>
================end new functional choose
Michael Case wrote:
>
> Hi,
>
> Please help. I'm not sure where to send such questions.
>
> I am using testXSLT which reports its version as
>
> -- TestXSLT version 1.1.0 (Xalan C++ version 1.1.0)
>
> I am getting an error in a called template which is included into the
> main document and works for most cases. In the very bottom is a section
> like this:
>
> ---------------snippet---------------
> <xsl:choose>
> <!-- handle with decimal place -->
> <xsl:when test="$voffset != 0 or $hasdecimal != 0">
> <xsl:value-of select="concat($vsgn,
> substring-before($vmantisa, '.'), substring-after($vmantisa, '.'),
> substring($max-exp, 1, ($vexponent - $voffset)))"/>
> </xsl:when>
>
> <!-- handle when no decimal -->
> <xsl:when test="$voffset == 0 and $hasdecimal == 0">
> <xsl:value-of select="concat($vsgn, $vmantisa,
> substring($max-exp, 1, $vexponent))"/>
> </xsl:when>
>
> </xsl:choose>
> -----------------endsnippet-------------------
>
> I have tried all sorts of things. But here is the deal. If I take out
> the second xsl:when then it completes. When I put it back in I get
> errors like (-TT, -TG, -TS, -TTC used):
>
> ===============start tail of screen output================
> Line #189, Column #36, xsl:value-of, select="$voffset": 0
> STARTELEMENT: td
> CHARACTERS: 0
> Line #189, Column #60: #text
> CHARACTERS:
> Line #190, Column #39: xsl:value-of
> Line #190, Column #39, xsl:value-of, select="$hasdecimal": 0
> CHARACTERS: 0
> Line #190, Column #63: #text
> CHARACTERS:
> Line #191, Column #37: xsl:value-of
> Line #191, Column #37, xsl:value-of, select="$vmantisa": 1
> CHARACTERS: 1
> Line #191, Column #61: #text
> CHARACTERS:
> Line #192, Column #38: xsl:value-of
> Line #192, Column #38, xsl:value-of, select="$vexponent": 16
> CHARACTERS: 16
> Line #192, Column #62: #text
> CHARACTERS:
> Line #194, Column #29: xsl:choose
> Line #197, Column #70, xsl:when, test="$voffset != 0 or $hasdecimal !=
> 0": false
> XSL Error: Unknown axis!, style tree node: mynum
>
> XSLException Type is : XSLTProcessorException
> Message is : Unknown axis!
> =================end of tail of screen output=============
>
> Where mynum is the node being processed in the original document (the
> one that includes the called template, and calls the template).
>
> If you want to see all the xml/xsl let me know. I'll also list (below)
> the input and output of the version where I take out the second when.
>
> Thanks for any help.
>
> Sincerely,
>
> Michael E. Case
> UC Davis
> [EMAIL PROTECTED]
> (530) 754-7226
> ======================================TestNumber.xml
> <?xml version='1.0' encoding='UTF-8'?>
> <main>
> <mynum num="1"/>
> <mynum num="-2"/>
> <mynum num="3E-3"/>
> <mynum num="-2E-4"/>
> <mynum num=".5E-3"/>
> <mynum num=".3E4"/>
> <mynum num=".2E-4"/>
> <mynum num="-.6E3"/>
> <mynum num="-.6E-4"/>
> <mynum num="6.022E23"/>
> <mynum num=".312E1"/>
> <mynum num="312E-2"/>
> <mynum num="-0.312E1"/>
> <mynum num="-312E-2"/>
> <mynum num="923.9E-1"/>
> <mynum num="1.625E-12"/>
> <mynum num="1.E-5"/>
> <mynum num="2.14160E-3"/>
> <mynum num="2.14160e-3"/>
> <mynum num="1E16"/>
> <mynum num="1.E16"/>
> </main>
> ======================================TestNumberOut.xml
> <?xml version="1.0" encoding="UTF-8"?>
> <html><head><title>Output for web page</title></head><body><table
> border="1"
> align="center"><th>num</th><th>converted</th><th>number()</th>
> <tr><td>1</td><td>1</td><td>1</td></tr>
> <tr><td>-2</td><td>-2</td><td>-2</td></tr>
> <tr><td>3E-3</td><td>0.003</td><td>NaN</td></tr>
> <tr><td>-2E-4</td><td>-0.0002</td><td>NaN</td></tr>
> <tr><td>.5E-3</td><td>0.0005</td><td>NaN</td></tr>
> <tr><td>.3E4</td><td>3000</td><td>NaN</td></tr>
> <tr><td>.2E-4</td><td>0.00002</td><td>NaN</td></tr>
> <tr><td>-.6E3</td><td>-600</td><td>NaN</td></tr>
> <tr><td>-.6E-4</td><td>-0.00006</td><td>NaN</td></tr>
> <tr><td>6.022E23</td><td>3 1 6.022 23
> 602200000000000000000000</td><td>NaN</td></tr>
> <tr><td>.312E1</td><td>3.12</td><td>NaN</td></tr>
> <tr><td>312E-2</td><td>3.12</td><td>NaN</td></tr>
> <tr><td>-0.312E1</td><td>-3.12</td><td>NaN</td></tr>
> <tr><td>-312E-2</td><td>-3.12</td><td>NaN</td></tr>
> <tr><td>923.9E-1</td><td>92.39</td><td>NaN</td></tr>
> <tr><td>1.625E-12</td><td>0.000000000001625</td><td>NaN</td></tr>
> <tr><td>1.E-5</td><td>0.00001</td><td>NaN</td></tr>
> <tr><td>2.14160E-3</td><td>0.0021416</td><td>NaN</td></tr>
> <tr><td>2.14160e-3</td><td>0.0021416</td><td>NaN</td></tr>
> <tr><td>1E16</td><td>0 0 1 16 </td><td>NaN</td></tr>
> <tr><td>1.E16</td><td>0 0 1 16 </td><td>NaN</td></tr>
> </table></body></html>
--
Michael E. Case
UC Davis
[EMAIL PROTECTED]
(530) 754-7226