开发者

bug of RapidXML when the value of a xml node is null

开发者 https://www.devze.com 2023-01-16 15:41 出处:网络
If the value of node in the xml is null, when we print the xml node, the node has no start tag, but only the end tag. For example:

If the value of node in the xml is null, when we print the xml node, the node has no start tag, but only the end tag. For example:

xml_document<char> doc;
doc.append_node(doc.allocate_node(rapidxml::node_element, "mynode", ""));
ofstream ofs("t开发者_如何学Pythonest.xml");
ofs<<doc;

the content of test.xml is:

</mynode>

the expected content of test.xml is

<mynode></mynode>

Is this a bug of rapidxml


I do not know what version of RapidXml you're using. I've used few days ago the latest and works fine... this problem was fixed or it was a particular case of yours :)

0

精彩评论

暂无评论...
验证码 换一张
取 消