axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dumi...@apache.org
Subject svn commit: r761571 - /webservices/axis2/trunk/c/axiom/src/xpath/xpath.c
Date Fri, 03 Apr 2009 08:45:07 GMT
Author: dumindu
Date: Fri Apr  3 08:45:07 2009
New Revision: 761571

URL: http://svn.apache.org/viewvc?rev=761571&view=rev
Log:
XPath expects a dummy root node. Added that to evaluate() logic, so that it's easier for the
user.


Modified:
    webservices/axis2/trunk/c/axiom/src/xpath/xpath.c

Modified: webservices/axis2/trunk/c/axiom/src/xpath/xpath.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/xpath/xpath.c?rev=761571&r1=761570&r2=761571&view=diff
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/xpath/xpath.c (original)
+++ webservices/axis2/trunk/c/axiom/src/xpath/xpath.c Fri Apr  3 08:45:07 2009
@@ -30,12 +30,18 @@
 {
     axiom_xpath_context_t* context;
 
+    /*HACK: xpath impl requires a dummy root node in order to process properly.*/
+    axiom_node_t * dummy_root;
+    dummy_root = axiom_node_create(env);
+    axiom_node_add_child(dummy_root, env, root_node);
+
+
     context = AXIS2_MALLOC(env->allocator,
             sizeof(axiom_xpath_context_t));
 
     context->env = env;
-    context->root_node = root_node;
-    context->node = root_node;
+    context->root_node = dummy_root;
+    context->node = dummy_root;
     context->expr = NULL;
     context->attribute = NULL;
     context->namespaces = NULL;
@@ -77,7 +83,7 @@
     axiom_xpath_expression_copy(context, xpath_expr);
 
     context->streaming = AXIS2_FALSE;
-
+    
     return axiom_xpath_run(context);
 }
 



Mime
View raw message