libxml2 can´t get content from node libxml2 can´t get content from node xml xml

libxml2 can´t get content from node


Short answer: use xmlNodeGetContent.

Element nodes themselves don't contain content. Instead, they have children text nodes, and those contain content. The contents of an element may be a mix of text and tags, and this allows it to maintain the ordering, represent entities, etc.

You could iterate over the child nodes and look at THEIR content members, but xmlNodeGetContent does that for you, and will handle child tags and entities properly.