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 The comment on the change is: Registering namespaces ------------------------------------------------------------------------------ == 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. + Creates a axiom_xpath_expression by parsing xpath_expr. All parse errors will be handled by this function. All parse errors will be logged if necessary. ===== Example: ===== {{{ axiom_xpath_expression_t *exp = axiom_xpath_create_expression(env, "/father/son"); }}} + ==== axiom_xpath_namespace_list* axiom_xpath_create_namespace_list(const axutil_env_t *env) ==== + Creates an empty axiom_xpath_namespace_list. This will be used to register namespaces. + ===== Example: ===== + {{{ + axiom_xpath_namespace_list *namespaces = axiom_xpath_create_namespace_list(env); + }}} + + ==== void axiom_xpath_register_namespace(const axutil_env_t *env, axiom_xpath_namespace_list * namespaces, const axis2_char_t* prefix, const axis2_char_t* uri) ==== + Adds an namespace to list of namespaces. + ===== Example:: ===== + {{{ + axiom_xpath_register_namespace(env, namespaces, "red", "http://www.xvpj.net/red"); + }}} + - ==== 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) ==== + ==== 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, const axiom_xpath_namespace_list * namespaces = NULL) ==== Evaluates the xpath expression and return the results. ===== Example:: ===== {{{ - axiom * nodes axiom_xpath_select_nodes(env, root, exp); + axiom_xpath_result_t* result = axiom_xpath_select_nodes(env, root, exp); }}} + ---- + ''It is also possible to use a xpath context (as in libxml xpath module) where the context is initialized with the root node and then namespaces are registered'' ==== 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. + Returns the axiom node in the result. If the type of result is 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
