以文本方式查看主题

-  计算机科学论坛  (http://bbs.xml.org.cn/index.asp)
--  『 XML工具及XML开发环境 』  (http://bbs.xml.org.cn/list.asp?boardid=7)
----  c libxml2删除xml某个节点的某个属性  (http://bbs.xml.org.cn/dispbbs.asp?boardid=7&rootid=&id=63164)


--  作者:liw1029
--  发布时间:5/28/2008 11:07:00 AM

--  c libxml2删除xml某个节点的某个属性
请问怎么用c libxml2去删除某个节点的某个属性?
谢谢!
--  作者:xiaoxin4
--  发布时间:6/19/2008 10:50:00 AM

--  
if(xmlHasProp(curNode,BAD_CAST"attribute"))
{
 xmlAttrPtr attrPtr = curNode->properties;
 while(attrPtr != NULL)
 {
  if(!xmlStrcmp(attrPtr->name,BAD_CAST"attribute"))
  {
   xmlAttrPtr tmp = attrPtr->next;
   xmlRemoveProp(attrPtr);
   attrPtr = tmp;
   continue;
  }
  attrPtr = attrPtr->next;
 }
}
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
46.875ms