You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ws.apache.org by Apache Wiki <wi...@apache.org> on 2008/03/25 16:47:36 UTC

[Ws Wiki] Update of "axiom-xpath-api-gsoc-varuna" by VarunaJayasiri

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Ws Wiki" for change notification.

The following page has been changed by VarunaJayasiri:
http://wiki.apache.org/ws/axiom-xpath-api-gsoc-varuna

New page:
== Axiom XPath API ==

This is not intended to be a comprehensive API documentation, but an overview of proposed API for Google Summer of Code project.

== Functions ==

==== axiom_xpath_expression_t* axiom_xpath_create_expression(const axutil_env_t *env, const axis2_char_t* xpath_expr) ====
Creates a axiom_xpath_expression by parsing xpath_expr. All parse errors will be handled by this function. All parse errors will be written to log.
===== Example: =====
{{{
axiom_xpath_expression_t *exp = axiom_xpath_create_expression(env, "/father/son");
}}}

==== axiom_xpath_result_t* axiom_xpath_evaluate(const axutil_env_t *env, const axiom_node_t * root_node, const axiom_xpath_expression_t * xpath_expr) ====
Evaluates the xpath expression and return the results.
===== Example:: =====
{{{
axiom * nodes axiom_xpath_select_nodes(env, root, exp);
}}}

==== axiom_xpath_result_type_t axiom_xpath_get_result_type(axiom_xpath_result_t * result) ====
Gets the type of result obtained by evaluating the xpath expression. This could be a string, number, boolean, node or a list of nodes.
----
''I have slightly deviated from the Jaxen API where an Object is returned. Because it wouldn't be possible to do something like that here since we do not have the facility (Java: instance of) of checking what type of result was returned if a void pointer is returned.''

==== axiom_node_t* axiom_xpath_get_node(axiom_xpath_result_t * result) ====
Returns the axiom node in the result. If the type of result if not node, NULL will be returned.

===== Other functions to process results =====
Other functions to process the results will have a similar interface

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@ws.apache.org
For additional commands, e-mail: general-help@ws.apache.org