Re: [xslt] 1.0 != 1.0?



It gets better as you go along .....

<?xml version="1.0" encoding="US-ASCII"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                version='1.0'>

<xsl:template match="/">
  <xsl:variable name="scale">1.0</xsl:variable>
  <xsl:variable name="q">2.0</xsl:variable>

  <xsl:message>$scale = <xsl:value-of select="$scale"/></xsl:message>
  <xsl:message>Is it =? <xsl:value-of select="$scale = 1.0"/></xsl:message>
  <xsl:message>Is it !=? <xsl:value-of select="$scale !=
1.0"/></xsl:message>
  <xsl:message>Is it &lt;? <xsl:value-of select="$scale &lt;=
1.0"/></xsl:message>
  <xsl:message>Is it &gt;? <xsl:value-of select="$scale &gt;=
1.0"/></xsl:message>
</xsl:template>

</xsl:stylesheet>

bill@mmm1:/mnt/hdd2/usr/projects/work$ xsltproc walsh.xsl bug.xml
$scale = 1.0
Is it =? false
Is it !=? true
Is it <? true
Is it >? true

----- Original Message -----
From: "Norman Walsh" <ndw@nwalsh.com>
To: <xslt@gnome.org>
Sent: Tuesday, July 09, 2002 1:44 AM
Subject: [xslt] 1.0 != 1.0?


> Try this:
>
> <?xml version="1.0" encoding="US-ASCII"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
>
xmlns:ptbl="http://nwalsh.com/xslt/ext/xsltproc/python/Table";
>                 exclude-result-prefixes="ptbl"
>                 version='1.0'>
>
> <xsl:template match="/">
>   <xsl:variable name="scale">
>     <xsl:choose>
>       <xsl:when test="@contentwidth or @contentdepth">1.0</xsl:when>
>       <xsl:when test="@scale">
>         <xsl:value-of select="@scale div 100.0"/>
>       </xsl:when>
>       <xsl:otherwise>1.0</xsl:otherwise>
>     </xsl:choose>
>   </xsl:variable>
>
>   <xsl:message>$scale = <xsl:value-of select="$scale"/></xsl:message>
>   <xsl:message>Is $scale != 1.0? <xsl:value-of select="$scale !=
1.0"/></xsl:message>
> </xsl:template>
>
> </xsl:stylesheet>
>
>
>                                         Be seeing you,
>                                           norm





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]