Re: [xslt] Problem with variables



Using libxslt1.0.17 under CYGWIN I get:

   %25
   %25.5
   %25.480
   %25.48

I am assuming the mixture of b.xsl and c.xsl in your output as well as the 
lowercase a (<aAAA>) in a.xml are typo's in the email.
I ran using the same windows version you listed and got:
runtime error: file b.xsl line 5 element variable
Global variable G already defined
%25%25.5%25.480%25.48

Looks like a problem with the windows version only.

Charlie B.

Quoting Richard Jinks <cyberthymia@yahoo.co.uk>:

> Hi
> 
> Can someone suggest whats going wrong here? I've had a look through
> the
> libxslt code, but can't find anything obvious.
> 
> (Using Igor's Win32 binaries libxml2.2-4-21, libxslt1.0.17 on Win2000)
> 
> a.xml:
> <?xml version="1.0"?>
> <AAA author="nicmila@idoox.com">
>      <BBB>bbb</BBB>
>      <CCC>ccc</CCC>
> </AAA>
> 
> b.xsl:
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
> version="1.0">
> <xsl:output method="text"/>
> <xsl:variable name="G">0.2548</xsl:variable>
> <xsl:template match="/">
>   <xsl:text>
>   </xsl:text>
>   <xsl:value-of select="format-number($G,'%')"/>
>   <xsl:text>
>   </xsl:text>
>   <xsl:value-of select="format-number($G,'%#.#')"/>
>   <xsl:text>
>   </xsl:text>
>   <xsl:value-of select="format-number($G,'%#.000')"/>
>   <xsl:text>
>   </xsl:text>
>   <xsl:value-of select="format-number($G,'%#.#####')"/>
> </xsl:template>
> </xsl:stylesheet>
> 
> C:\libxml\libxslt-1.0.17.win32\util>xsltproc b.xsl a.xml
> xsltproc c.xsl a.xml
> runtime error: file c.xsl line 4 element variable
> Global variable G already defined
> %25%25.5%25.480%25.48
> 
> There appears to be two problems here:
> 1) The runtime error stating that variable "G" is already defined.
> 2) I'd expect the formatted numbers to each appear on new lines (but
> this
> could quite easily go down to a gap in my understanding of
> <xsl:text/>)
> 
> Any ideas?
> 
> Thanks,
> Richard
> 
> 
> 
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
> 
> _______________________________________________
> xslt mailing list, project page http://xmlsoft.org/XSLT/
> xslt@gnome.org
> http://mail.gnome.org/mailman/listinfo/xslt
> 



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