<?xml version="1.0" encoding="UTF-8"?>
<Parameter>
<Puntitled a="6378245" f="298.3">
</Puntitled>
</Parameter>本来我是想做成这样一种结构的,可是调用CMarkup的函数添加
结果成了这样的结构
<?xml version="1.0" encoding="UTF-8"?>
<Parameter>
<Puntitled a="6378245" f="298.3">
</Puntitled>
<PWGS72 a="6378135" f="298.26"/>
<PINTERNATIONAL a="6378388" f="297"/>
<PGRS80 a="6378137" f="298.2572221"/>
<PWGS66 a="6378145" f="298.25"/>
</Parameter>
用解析器看,也没错
但却删除不了节点
bool CPage2::DeleteEllipsoidFromXML(CString strParameterName)
{
if(!xml.Load(ELLIPSOID_SYSTEM_FILENAME))
{
MessageBox(xml.GetError()+ELLIPSOID_SYSTEM_FILENAME, _T("文件读取错误"), MB_OK);
return false;
}
if (xml.FindChildElem(PREFIX_ELEM_NAME+strParameterName))
{
if (!xml.RemoveChildElem())
{
MessageBox(xml.GetError(), _T("删除节点错误"), MB_OK);
return false;


if (!xml.Save(PARAMETER_FILENAME))
{
MessageBox(xml.GetError(), _T("保存文件失败"), MB_OK);
return false;


}
return true;
}没有一个地儿报错,但却删除不掉文件中的节点