iterating NodeList::iterator gives "Text" nodes
- From: Pablo Madoery <madoerypablo gmail com>
- To: libxmlplusplus-list gnome org
- Subject: iterating NodeList::iterator gives "Text" nodes
- Date: Thu, 29 Aug 2013 16:00:28 -0300
Hello. I have this code and it generate some xml like this:
<?xml version="1.0" encoding="UTF-8"?>
<Scenario>
<A/>
<B/>
<C/>
</Scenario>
When i want to obtain all the childs Elements (A, B, C) i use a list in this way
xmlpp::Node::NodeList list = rootNode->get_children();
for (xmlpp::Node::NodeList::iterator cur = list.begin(); cur != list.end(); ++cur)
{
cout<<(*cur)->get_name()<<endl;
}
when i obtain the list:
text
A
text
B
text
C
text
Why has it TextNodes interleaved with the Nodes i want ?
- xmlpp::Node:
- xmlpp::Attribute
- xmlpp::ContentNode
- xmlpp::CdataNode
- xmlpp::CommentNode
- xmlpp::ProcessingInstructionNode
- xmlpp::TextNode
- xmlpp::Element
- xmlpp::EntityReference
is there some documentation that explains better inheritance hierarchy of node types and when is used each?
Thank you very much for your time !!!
Attachment:
main.cc
Description: Binary data
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]