diff --git a/src/common/Attribute.cc b/src/common/Attribute.cc index 8f92b513f9..9df5bb078d 100644 --- a/src/common/Attribute.cc +++ b/src/common/Attribute.cc @@ -75,8 +75,20 @@ string * VectorAttribute::to_xml() const for (it=attribute_value.begin();it!=attribute_value.end();it++) { - oss << "<" << it->first << ">second - << "]]>first << ">"; + if ( it->first.empty() ) + { + continue; + } + + if ( it->second.empty() ) + { + oss << "<" << it->first << "/>"; + } + else + { + oss << "<" << it->first << ">second + << "]]>first << ">"; + } } oss << ""; @@ -133,9 +145,16 @@ void VectorAttribute::unmarshall(const string& sattr, const char * _sep) { continue; } - - attribute_value.insert(make_pair(tmp.substr(0,mpos), - tmp.substr(mpos+1))); + + if ( mpos + 1 == tmp.size() ) + { + attribute_value.insert(make_pair(tmp.substr(0,mpos),"")); + } + else + { + attribute_value.insert(make_pair(tmp.substr(0,mpos), + tmp.substr(mpos+1))); + } } } /* -------------------------------------------------------------------------- */