axl main logo
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules Pages
axl_bool axl_ns_node_cmp ( axlNode node,
const char *  ns,
const char *  name 

Allows to perform a node name (tag) checking using XML 1.0 Namespace rules.

This function must be used instead of NODE_CMP_NAME if your application must support XML 1.0 namespaces.

The idea is that you declares the namespace that you will recognize using a macro definition at some place in your headers, as follows:

1 #define YOUR_NS ""

Previous namespace must be unique. This is crucial to avoid tag clashing. Now, you use this namespace identifier and the local name of your tag to check a particular node to have a particular name as follows:

1 if (axl_ns_node_cmp (node, YOUR_NS, "table")) {
2  // found table node inside your namespace
3 }

It is required to call first to axl_ns_doc_validate in order to make this function to properly work.

nodeThe node that will be checked.
nsThe namespace to use to match the node name.
nameThe node name to be checked (without namespace prefixes).
axl_true if the node name is the one expected, binded by the namespace declaration, otherwise axl_false is returned. The function returns axl_false in the of some paremeter is provided null.

References axl_cmp(), axl_false, axl_node_get_name(), axl_ns_node_is_prefixed(), and axl_return_val_if_fail.

Referenced by axl_ns_node_get_child_called(), axl_ns_node_get_next_called(), and axl_ns_node_get_previous_called().