/*
 * $Id: XMLUtils_testAttributesEmpty.cpp 88 2008-12-10 18:31:39Z rosiere $
 *
 * [ Description ]
 * 
 */

#include "Behavioural/Configuration/include/XMLUtils.h"

namespace morpheo {
namespace behavioural {
namespace configuration {

#undef  FUNCTION
#define FUNCTION "testAttributesEmpty"
  void testAttributesEmpty (XML_t *      xml,
                            attributes_t attributes)
  {
    // Test if attributes is empty
    if (not attributes.empty())
      {
        std::string msg = "";
        for (attributes_t::iterator it=attributes.begin();
             it!=attributes.end();
             ++it)
          {
            if (it!=attributes.begin())
              msg+= ", ";
            msg+=it->first;
          }
        throw ERRORMORPHEO(FUNCTION,toString(_("Syntax error, node \"%s\" must have not this attributes : %s\n"),xml->getName().c_str(),msg.c_str()));
      }
  }

}; // end namespace configuration
}; // end namespace behavioural
}; // end namespace morpheo              
