我在解析 XML 注释时遇到问题。我怎样才能正确访问评论?或者甚至可以用 tinyXML2 阅读评论?
<xml>
<foo> Text <!-- COMMENT --> <foo2/></foo>
</xml>
我建立
XMLElement *root = xmlDoc->FirstChildElement("foo");
XMLElement *child = root->FirstChildElement();
从子元素我得到 foo2 元素,从文件中读取注释元素的正确方法是什么。
谢谢