#include <libxml++/libxml++.h>
#include <iostream>
#include <libxml/tree.h>

int main()
{
    xmlpp::DomParser parser("bug.xml");
    const xmlpp::Node* root = parser.get_document()->get_root_node();

    xmlpp::NodeSet nodes = root->find("/*/namespace::*");

    std::cout << nodes.size() << std::endl;

    xmlpp::Node* node = nodes[0];
    if(node)
      std::cout << node << " ";
    else
      std::cout << "nodes[0] is NULL, ";

    node = nodes[1];
    if(node)
      std::cout << node << " ";
    else
      std::cout << "nodes[1] is NULL, ";

    node = nodes[2];
    if(node)
      std::cout << node << " ";
    else
      std::cout << "nodes[2] is NULL, ";

    node = nodes[0];
    if(node)
    {
      _xmlNode* cobj = node->cobj();
      if(!cobj)
        std::cout << "nodes[0]->cobj() is NULL" << std::endl;
      else
      {
        std::cout << "cobj=" << node->cobj() << std::endl;
        std::cout << "cobj->name=" << node->cobj()->name << std::endl;

        std::cout << std::endl << node->get_name() << std::endl;
      }
    }
}

