Removed the exclude-result-prefix change of 31 May 2007. Fixes bug
authorWilliam M. Brack <wbrack@src.gnome.org>
Thu, 26 Jul 2007 19:42:32 +0000 (19:42 +0000)
committerWilliam M. Brack <wbrack@src.gnome.org>
Thu, 26 Jul 2007 19:42:32 +0000 (19:42 +0000)
* libxslt/xslt.c: Removed the exclude-result-prefix change of
  31 May 2007.  Fixes bug #459713.

svn path=/trunk/; revision=1434

ChangeLog
libxslt/xslt.c

index 8a3abef..ec3d399 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Jul 26 12:43:38 PDT 2007 William Brack <wbrack@mmm.com.hk>
+
+       * libxslt/xslt.c: Removed the exclude-result-prefix change of
+         31 May 2007.  Fixes bug #459713.
+
 Sat Jun 16 07:42:18 PDT 2007 William Brack <wbrack@mmm.com.hk>
 
        * libxslt/transform.c: Fixed problem with RVT cleanup related
@@ -12,7 +17,7 @@ Tue Jun 12 18:43:05 CEST 2007 Daniel Veillard <daniel@veillard.com>
 
        * NEWS configure.in doc/*: preparing release of 1.1.21
 
-Thu May 31 12:38:08 PDT 2007 WIlliam Brack <wbrack@mmm.com.hk>
+Thu May 31 12:38:08 PDT 2007 William Brack <wbrack@mmm.com.hk>
 
        * libxslt/xslt.c: fixed obscure namespace problem related to
          exclude-result-prefix
index b0b3160..bead6db 100644 (file)
@@ -3469,7 +3469,7 @@ xsltPrecomputeStylesheet(xsltStylesheetPtr style, xmlNodePtr cur)
            }
                     
            if ((cur->nsDef != NULL) && (style->exclPrefixNr > 0)) {
-               xmlNsPtr ns = cur->nsDef, prev = NULL, next, rns;
+               xmlNsPtr ns = cur->nsDef, prev = NULL, next;
                xmlNodePtr root = NULL;
                int i, moved;
 
@@ -3482,27 +3482,18 @@ xsltPrecomputeStylesheet(xsltStylesheetPtr style, xmlNodePtr cur)
                            if ((ns->prefix != NULL) && 
                                (xmlStrEqual(ns->href,
                                             style->exclPrefixTab[i]))) {
-                               /* Remove the namespace from this node */
-                               if (prev == NULL) {
-                                   cur->nsDef = ns->next;
-                               } else {
-                                   prev->next = ns->next;
-                               }
                                /*
-                                * If this prefix is not already present,
-                                * move the namespace definition on the root
+                                * Move the namespace definition on the root
                                 * element to avoid duplicating it without
                                 * loosing it.
                                 */
-                               for (rns = root->nsDef; rns != NULL; rns = rns->next)
-                                   if (xmlStrEqual(ns->prefix, rns->prefix))
-                                       break;
-                               if (rns == NULL) {
-                                   ns->next = root->nsDef;
-                                   root->nsDef = ns;
+                               if (prev == NULL) {
+                                   cur->nsDef = ns->next;
+                               } else {
+                                   prev->next = ns->next;
                                }
-                               else
-                                   xmlFreeNs(ns);
+                               ns->next = root->nsDef;
+                               root->nsDef = ns;
                                moved = 1;
                                break;
                            }