applied patch from Mike Hommey about saving the current in-scope namespace
authorDaniel Veillard <veillard@src.gnome.org>
Thu, 23 Nov 2006 16:46:39 +0000 (16:46 +0000)
committerDaniel Veillard <veillard@src.gnome.org>
Thu, 23 Nov 2006 16:46:39 +0000 (16:46 +0000)
* libxslt/transform.c: applied patch from Mike Hommey about saving
  the current in-scope namespace list when calling a template, fixes
  bug #377579
Daniel

ChangeLog
libxslt/transform.c

index 42240c7..0d4ff51 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Nov 23 17:49:31 CET 2006 Daniel Veillard <daniel@veillard.com>
+
+       * libxslt/transform.c: applied patch from Mike Hommey about saving
+         the current in-scope namespace list when calling a template, fixes
+         bug #377579
+
 Thu Nov 23 15:36:28 CET 2006 Daniel Veillard <daniel@veillard.com>
 
        * configure.in: fix a python detection problem pointed out by 
index 7c0461d..95f598a 100644 (file)
@@ -4638,11 +4638,12 @@ xsltApplyTemplates(xsltTransformContextPtr ctxt, xmlNodePtr node,
     xmlNodePtr cur, delNode = NULL, oldContextNode;    
     xmlNodeSetPtr list = NULL, oldList;
     xsltStackElemPtr withParams = NULL;
-    int oldXPProximityPosition, oldXPContextSize;
+    int oldXPProximityPosition, oldXPContextSize, oldXPNsNr;
     const xmlChar *oldMode, *oldModeURI;
     xmlDocPtr oldXPDoc;
     xsltDocumentPtr oldDocInfo;
     xmlXPathContextPtr xpctxt;
+    xmlNsPtr *oldXPNamespaces;
 
     if (comp == NULL) {
        xsltTransformError(ctxt, NULL, inst,
@@ -4676,6 +4677,8 @@ xsltApplyTemplates(xsltTransformContextPtr ctxt, xmlNodePtr node,
     oldXPContextSize = xpctxt->contextSize;
     oldXPProximityPosition = xpctxt->proximityPosition;
     oldXPDoc = xpctxt->doc;
+    oldXPNsNr = xpctxt->nsNr;
+    oldXPNamespaces = xpctxt->namespaces;
 
     /*
     * Set up contexts.
@@ -4993,6 +4996,8 @@ error:
     /*
     * Restore context states.
     */
+    xpctxt->nsNr = oldXPNsNr;
+    xpctxt->namespaces = oldXPNamespaces;
     xpctxt->doc = oldXPDoc;
     xpctxt->contextSize = oldXPContextSize;
     xpctxt->proximityPosition = oldXPProximityPosition;