Re: [xslt] context changing inside concat() function?



On Tue, May 14, 2002 at 02:36:09PM +0400, Alexey Efimov wrote:
> Hello.
> Please, tell me, if such behavior of libxslt is right?

  No. You're right it's a bug !

> I think that context was changed inside concat() function.

  exact !

> msxml output is:
> <?xml version="1.0" encoding="UTF-16"?>bb:aa:bb

  Hum, you mean aa:aa:aa, right ?

  The enclosed fix must be applied to libxml2, it's commited in CVS

  thanks for the report !

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/
Index: xpath.c
===================================================================
RCS file: /cvs/gnome/gnome-xml/xpath.c,v
retrieving revision 1.189
retrieving revision 1.190
diff -c -r1.189 -r1.190
*** xpath.c	14 May 2002 06:41:30 -0000	1.189
--- xpath.c	14 May 2002 11:03:59 -0000	1.190
***************
*** 9861,9871 ****
--- 9861,9877 ----
                  return (total);
              }
          case XPATH_OP_ARG:
+ 	    bakd = ctxt->context->doc;
+ 	    bak = ctxt->context->node;
              if (op->ch1 != -1)
                  total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
+ 	    ctxt->context->doc = bakd;
+ 	    ctxt->context->node = bak;
  	    CHECK_ERROR0;
              if (op->ch2 != -1)
                  total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
+ 	    ctxt->context->doc = bakd;
+ 	    ctxt->context->node = bak;
  	    CHECK_ERROR0;
              return (total);
          case XPATH_OP_PREDICATE:


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