<commit_before>// Parse test application
// Based upon: parsetest.cpp from xmlpp

// needed includes
#include <fstream>
#include <iostream>
#include <ctime>
#include <xmlpp/xmlpp.h>

// namespace includes
using namespace xmlpp;
using namespace std;


// dumps the node
void dump_node( xmlnode &node, int level = 0 )
{
   xmlstring name = node.name();
   xmlnodetype type = node.get_type();

   for(int i=0;i<level;i++) cout << " ";

   char c = ' ';
   switch(type)
   {
   case xml_nt_node:
      c = '+';
      break;
   case xml_nt_leaf:
      c = '-';
      break;
   case xml_nt_document:
      c = '\\';
      break;
   case xml_nt_cdata:
      c = '#';
      name = node.get_cdata();
      break;
   }

   cout << c << name.c_str() << endl;
   xmlattributes attr = node.get_attrmap();

   // guru: added output of attributes
   for (xmlattributes::iterator j = attr.begin(); j!=attr.end(); j++)
   {
      for (int i=0; i<level; i++) cout << " ";
      cout << "   ";
      cout << j->first << ": " << j->second << endl;
   }

   xmlnodelist& nlist = node.children();

   xmlnodelist::const_iterator iter, stop;
   iter = nlist.begin();
   stop = nlist.end();<commit_msg>Output cdata node name as well as data.<commit_after>// Parse test application
// Based upon: parsetest.cpp from xmlpp

// needed includes
#include <fstream>
#include <iostream>
#include <ctime>
#include <xmlpp/xmlpp.h>

// namespace includes
using namespace xmlpp;
using namespace std;


// dumps the node
void dump_node( xmlnode &node, int level = 0 )
{
   xmlstring name = node.name();
   xmlnodetype type = node.get_type();
   xmlstring c_data;

   for(int i=0;i<level;i++) cout << " ";

   char c = ' ';
   switch(type)
   {
   case xml_nt_node:
      c = '+';
      break;
   case xml_nt_leaf:
      c = '-';
      break;
   case xml_nt_document:
      c = '\\';
      break;
   case xml_nt_cdata:
      c = '#';
      c_data = node.get_cdata();
      break;
   }

   if(type == xml_nt_cdata)
      cout << c << name.c_str() << "[" << c_data << "]" << endl;
   else
      cout << c << name.c_str() << endl;

   xmlattributes attr = node.get_attrmap();

   // guru: added output of attributes
   for (xmlattributes::iterator j = attr.begin(); j!=attr.end(); j++)
   {
      for (int i=0; i<level; i++)
         cout << " ";
      cout << "   ";
      cout << j->first << ": " << j->second << endl;
   }

   xmlnodelist& nlist = node.children();

   xmlnodelist::const_iterator iter, stop;
   iter = nlist.begin();
   stop = nlist.end();
{'fraction_non_alphanumeric': 0.16435093290988487, 'fraction_numerical': 0.0023818975784041284, 'mean_word_length': 2.5048678720445063, 'pattern_counts': {'":': 2, '<': 67, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 32}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '325056', 'n_tokens_mistral': 904, 'n_tokens_neox': 879, 'n_words': 228}