Changeset 35:1285e35e00f3 in rrlib_xml


Ignore:
Timestamp:
11.10.2011 15:24:09 (8 years ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
default
Phase:
public
Message:

Fixed issue in AddChildNode that prevents proper XML formatting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tXMLNode.cpp

    r34 r35  
    126126tXMLNode &tXMLNode::AddChildNode(const std::string &name, const std::string &content) 
    127127{ 
    128   return reinterpret_cast<tXMLNode &>(*xmlNewChild(this, 0, reinterpret_cast<const xmlChar *>(name.c_str()), reinterpret_cast<const xmlChar *>(content.c_str()))); 
     128  const char* c = (content.length() == 0) ? NULL : content.c_str(); 
     129  return reinterpret_cast<tXMLNode &>(*xmlNewChild(this, 0, reinterpret_cast<const xmlChar *>(name.c_str()), reinterpret_cast<const xmlChar *>(c))); 
    129130} 
    130131 
Note: See TracChangeset for help on using the changeset viewer.