Revision 2a508a11 src/common/Attribute.cc

View differences:

src/common/Attribute.cc
75 75

  
76 76
	for (it=attribute_value.begin();it!=attribute_value.end();it++)
77 77
	{
78
		oss << "<" << it->first << "><![CDATA[" << it->second
79
			<< "]]></"<< it->first << ">";
78
        if ( it->first.empty() )
79
        {
80
            continue;
81
        }
82

  
83
        if ( it->second.empty() )
84
        {
85
            oss << "<" << it->first << "/>";
86
        }
87
        else
88
        {
89
	    	oss << "<" << it->first << "><![CDATA[" << it->second
90
			    << "]]></"<< it->first << ">";
91
        }
80 92
	}
81 93

  
82 94
	oss << "</"<< name() << ">";
......
133 145
    	{
134 146
    		continue;
135 147
    	}
136

  
137
        attribute_value.insert(make_pair(tmp.substr(0,mpos),
138
                                         tmp.substr(mpos+1)));
148
        
149
        if ( mpos + 1 == tmp.size() )
150
        {
151
            attribute_value.insert(make_pair(tmp.substr(0,mpos),""));
152
        }
153
        else
154
        {
155
            attribute_value.insert(make_pair(tmp.substr(0,mpos),
156
                                             tmp.substr(mpos+1)));
157
        } 
139 158
    }
140 159
}
141 160
/* -------------------------------------------------------------------------- */

Also available in: Unified diff