axl main logo
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules Pages
axlNode * axl_doc_get ( axlDoc doc,
const char *  path_to 
)

Allows to return only one node for the selected path.

This function works the same way like axl_doc_get_list but extracting the first node reference found inside the list returned by the previous function, and returning it.

Many times, a path is selected because it is know that under that location couldn't be more than one element. However, using axl_doc_get_list function makes this task really anoying because you have to get the list, extract the node, from the list, and releasing the list reference to actually get access to the node looked up.

This function allows you to get access to the node stored on the selected location, and, if a path that provides several nodes is returned, only the first node found on that list is returned.

Parameters
docThe axlDoc document where the node will be returned.
path_toA path to the node to get.
Returns
A reference to a axlNode instace, or NULL if fails. Returned reference must not be deallocated.

References axl_doc_get_list(), axl_list_free(), axl_list_get_nth(), axl_list_length(), and axl_return_val_if_fail.

Referenced by axl_doc_get_content_at().