axl main logo
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules Pages
const char * axl_node_get_content ( axlNode node,
int *  content_size 
)

Allows to get current xml node content (axlNode).

See axl_node_is_empty for more details. This function allows to get current xml node content, which is the free text enclosed inside the node.

Returned value is an internal reference to the content stored. So, in the case a local copy is desired, you should check axl_node_get_content_copy.

Keep in mind that the content returned could have references like "&" or """ which are entities references not translated into the application level values.

This is done because while using the content, you may be interested in getting the raw content to be passed to another xml parser which is also able to process that entities.

If you don't like this behaviour you can check axl_node_get_content_trans which returns a copy for the xml node content with all entities references translated.

Here is a summary of functions available to get the content of a node:

  • axl_node_get_content_copy (the same like this function but producing an independent copy)
  • axl_node_get_content_trans (the same like this function but translating all entity references and producing an indenpendent copy).
  • axl_node_get_content_trim (the same like this function but removing initial and trailing white spaces in the W3C sense: spaces, tabulars, carry returns and line feed values).
Parameters
nodeThe axlNode node where the content will be retrieved.
content_sizeOptional pointer to an integer variable where the content size will be reported. If the variable is not set, the function will not report the content size. If this value is configured, it will contain the content size starting from 0 up to the content size.
Returns
Current xml node content. You must not deallocate reference returned. If you want a permanet copy you should use axl_node_get_content_copy. Keep in mind that the function will always return an string reference. In the case the node has no content, an empty string will be returned, not NULL.

References axl_item_get_type(), axl_return_val_if_fail, ITEM_CDATA, and ITEM_CONTENT.

Referenced by axl_doc_get_content_at(), and axl_node_get_content_copy().