Example #1
0
void XMLValueMap::startElement(const string &name, const XMLAttributes &attrs) {
  depth++;

  if (depth == 1) {
    if (name != root) THROWS("Invalid root element '" << name << "'");
    return;

  } else if (depth > 2)
    THROWS("Invalid child eleent '" << name << "' in XML value map");

  XMLAttributes::const_iterator it;

  it = attrs.find("v");
  if (it == attrs.end()) it = attrs.find("value");

  if (it != attrs.end()) {
    setXMLValue(name, it->second);
    xmlValueSet = true;

  } else xmlValueSet = false;
}