Re: [xslt] Peculiar xsl:number behavior or XSL mistake?



On Fri, Nov 14, 2003 at 06:56:01PM +0100, Bjorn Reese wrote:
> On Fri, 2003-11-14 at 07:56, Xyster ! wrote:
> > Hi,
> > 
> > I'm getting strange output from xsltproc on Windows ("Using libxml 20602, 
> > libxslt 10100 and libexslt 800") when trying to use xsl:number.
> 
> I have reproduced the error on Linux.

  Okay, bug report is http://bugzilla.gnome.org/show_bug.cgi?id=126994

> I think the patch below solves the problem (it does for the reported
> example), but I am not entirely sure because I do not understand
> how xsltGetUTF8Char is supposed to work -- the len argument seems
> to serve two purposes....

  hum, checking this ... 

> Index: preproc.c
> ===================================================================
> RCS file: /cvs/gnome/libxslt/libxslt/preproc.c,v
> retrieving revision 1.44
> diff -u -r1.44 preproc.c
> --- preproc.c   5 Nov 2003 03:16:43 -0000       1.44
> +++ preproc.c   14 Nov 2003 17:49:57 -0000
> @@ -771,6 +771,7 @@
>      prop = xsltGetNsProp(cur, (const xmlChar *)"grouping-separator",
>                         XSLT_NAMESPACE);
>      if (prop != NULL) {
> +       comp->numdata.groupingCharacterLen = xmlStrlen(prop);
>         comp->numdata.groupingCharacter =
>             xsltGetUTF8Char(prop,
> &(comp->numdata.groupingCharacterLen));
>         xmlFree(prop);

   Hum, this seems right, the *len is both IN and OUT, it's passed down
to xsltGetUTF8Char to give a limit of the length of the utf string.
And if not initialized well the result will fail randomly.

   thanks for chasing this :-)

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard@redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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