[libxslt] Rename xsltCopyTreeInternal to xsltCopyTree



commit 96c9c644f30ed762735802a27784cc522cff1643
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Tue Jan 3 17:04:28 2017 +0100

    Rename xsltCopyTreeInternal to xsltCopyTree
    
    The old xsltCopyTree was unused.

 libxslt/transform.c |   60 ++++++++++++--------------------------------------
 1 files changed, 15 insertions(+), 45 deletions(-)
---
diff --git a/libxslt/transform.c b/libxslt/transform.c
index fca5554..519133f 100644
--- a/libxslt/transform.c
+++ b/libxslt/transform.c
@@ -89,10 +89,9 @@ static xmlNsPtr
 xsltCopyNamespaceListInternal(xmlNodePtr node, xmlNsPtr cur);
 
 static xmlNodePtr
-xsltCopyTreeInternal(xsltTransformContextPtr ctxt,
-                    xmlNodePtr invocNode,
-                    xmlNodePtr node,
-                    xmlNodePtr insert, int isLRE, int topElemVisited);
+xsltCopyTree(xsltTransformContextPtr ctxt, xmlNodePtr invocNode,
+            xmlNodePtr node, xmlNodePtr insert, int isLRE,
+            int topElemVisited);
 
 static void
 xsltApplySequenceConstructor(xsltTransformContextPtr ctxt,
@@ -767,10 +766,6 @@ xsltFreeTransformContext(xsltTransformContextPtr ctxt) {
  *                                                                     *
  ************************************************************************/
 
-static xmlNodePtr
-xsltCopyTree(xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr insert,
-             int literal);
-
 /**
  * xsltAddChild:
  * @parent:  the parent node
@@ -1125,7 +1120,7 @@ exit:
  *
  * Do a copy of an attribute.
  * Called by:
- *  - xsltCopyTreeInternal()
+ *  - xsltCopyTree()
  *  - xsltCopyOf()
  *  - xsltCopy()
  *
@@ -1226,7 +1221,7 @@ xsltShallowCopyAttr(xsltTransformContextPtr ctxt, xmlNodePtr invocNode,
  * @target element node.
  *
  * Called by:
- *  - xsltCopyTreeInternal()
+ *  - xsltCopyTree()
  *
  * Returns 0 on success and -1 on errors and internal errors.
  */
@@ -1348,7 +1343,7 @@ xsltShallowCopyElem(xsltTransformContextPtr ctxt, xmlNodePtr node,
            *  copy over all namespace nodes in scope.
            *  The damn thing about this is, that we would need to
            *  use the xmlGetNsList(), for every single node; this is
-           *  also done in xsltCopyTreeInternal(), but only for the top node.
+           *  also done in xsltCopyTree(), but only for the top node.
            */
            if (node->ns != NULL) {
                if (isLRE) {
@@ -1406,7 +1401,7 @@ xsltCopyTreeList(xsltTransformContextPtr ctxt, xmlNodePtr invocNode,
     xmlNodePtr copy, ret = NULL;
 
     while (list != NULL) {
-       copy = xsltCopyTreeInternal(ctxt, invocNode,
+       copy = xsltCopyTree(ctxt, invocNode,
            list, insert, isLRE, topElemVisited);
        if (copy != NULL) {
            if (ret == NULL) {
@@ -1426,7 +1421,7 @@ xsltCopyTreeList(xsltTransformContextPtr ctxt, xmlNodePtr invocNode,
  * Do a copy of a namespace list. If @node is non-NULL the
  * new namespaces are added automatically.
  * Called by:
- *   xsltCopyTreeInternal()
+ *   xsltCopyTree()
  *
  * QUESTION: What is the exact difference between this function
  *  and xsltCopyNamespaceList() in "namespaces.c"?
@@ -1584,7 +1579,7 @@ occupied:
 }
 
 /**
- * xsltCopyTreeInternal:
+ * xsltCopyTree:
  * @ctxt:  the XSLT transformation context
  * @invocNode: responsible node in the stylesheet; used for error reports
  * @node:  the element node in the source tree
@@ -1603,10 +1598,9 @@ occupied:
  * Returns a pointer to the new tree, or NULL in case of error
  */
 static xmlNodePtr
-xsltCopyTreeInternal(xsltTransformContextPtr ctxt,
-                    xmlNodePtr invocNode,
-                    xmlNodePtr node,
-                    xmlNodePtr insert, int isLRE, int topElemVisited)
+xsltCopyTree(xsltTransformContextPtr ctxt, xmlNodePtr invocNode,
+            xmlNodePtr node, xmlNodePtr insert, int isLRE,
+            int topElemVisited)
 {
     xmlNodePtr copy;
 
@@ -1662,7 +1656,7 @@ xsltCopyTreeInternal(xsltTransformContextPtr ctxt,
        copy = xsltAddChild(insert, copy);
         if (copy == NULL) {
             xsltTransformError(ctxt, NULL, invocNode,
-            "xsltCopyTreeInternal: Copying of '%s' failed.\n", node->name);
+            "xsltCopyTree: Copying of '%s' failed.\n", node->name);
             return (copy);
         }
        /*
@@ -1793,34 +1787,11 @@ xsltCopyTreeInternal(xsltTransformContextPtr ctxt,
        }
     } else {
        xsltTransformError(ctxt, NULL, invocNode,
-           "xsltCopyTreeInternal: Copying of '%s' failed.\n", node->name);
+           "xsltCopyTree: Copying of '%s' failed.\n", node->name);
     }
     return(copy);
 }
 
-/**
- * xsltCopyTree:
- * @ctxt:  the XSLT transformation context
- * @node:  the element node in the source tree
- * @insert:  the parent in the result tree
- * @literal:  indicates if @node is a Literal Result Element
- *
- * Make a copy of the full tree under the element node @node
- * and insert it as last child of @insert
- * For literal result element, some of the namespaces may not be copied
- * over according to section 7.1.
- * TODO: Why is this a public function?
- *
- * Returns a pointer to the new tree, or NULL in case of error
- */
-static xmlNodePtr
-xsltCopyTree(xsltTransformContextPtr ctxt, xmlNodePtr node,
-            xmlNodePtr insert, int literal)
-{
-    return(xsltCopyTreeInternal(ctxt, node, node, insert, literal, 0));
-
-}
-
 /************************************************************************
  *                                                                     *
  *             Error/fallback processing                               *
@@ -4429,8 +4400,7 @@ xsltCopyOf(xsltTransformContextPtr ctxt, xmlNodePtr node,
                        xsltShallowCopyAttr(ctxt, inst,
                            ctxt->insert, (xmlAttrPtr) cur);
                    } else {
-                       xsltCopyTreeInternal(ctxt, inst,
-                           cur, ctxt->insert, 0, 0);
+                       xsltCopyTree(ctxt, inst, cur, ctxt->insert, 0, 0);
                    }
                }
            }


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