<map>
<道路 id="">
<高速公路 id="">
<a1 id="" pointX="20" pointY="20" />
<a2 id="" pointX="30" pointY="30" />
<a3 id="" pointX="40" pointY="40" />
<a4 id="" pointX="50" pointY="50" />
<a5 id="" pointX="60" pointY="60" />
<a6 id="" pointX="70" pointY="70" />
<a7 id="" pointX="80" pointY="80" />
<a8 id="" pointX="90" pointY="90" />
</高速公路>
</道路>
</map>用CMarkup查找节点时,使用m_xml.FindChildElem("a1")必须指定节点名,如果想遍历它,如何实现?
最终目标是找出pointX,pointY的所有值
<道路 id="">
<高速公路 id="">
<a1 id="" pointX="20" pointY="20" />
<a2 id="" pointX="30" pointY="30" />
<a3 id="" pointX="40" pointY="40" />
<a4 id="" pointX="50" pointY="50" />
<a5 id="" pointX="60" pointY="60" />
<a6 id="" pointX="70" pointY="70" />
<a7 id="" pointX="80" pointY="80" />
<a8 id="" pointX="90" pointY="90" />
</高速公路>
</道路>
</map>用CMarkup查找节点时,使用m_xml.FindChildElem("a1")必须指定节点名,如果想遍历它,如何实现?
最终目标是找出pointX,pointY的所有值
然后在FindElem("高速公路") && IntoElem()之后,while(FindElem("a"){}就可以了。如果非要用<a1><a2>...之类的,那就CString strTmp;
int i = 0;
strTmp.format("<a%d>", i);while(FindElem(strTmp))
{
i++;
strTmp.format("<a%d>", i);
}