小编Fah*_*had的帖子

xml解析错误属性名称重新定义

在我的 portscanner 程序中,我希望成功写入端口号、扫描方式和服务名称的输出。所以对于每个端口号、scannedby 和服务名称,我调用下面的 parseall 例程。

void parseall(int pid, char *scannedby, char *service){  // routine to add port, scannedby and service to xmlfile

  xmlDocPtr doc;  // pointer to parse xml Document

  xmlNodePtr cur = NULL;// node pointer. It interacts with individual node

  xmlAttrPtr attr; char portid[10];

  sprintf (portid,"%d",pid);  // converted int to string

  doc = xmlParseFile(xmlFileName); //parse filename

  cur = xmlDocGetRootElement(doc);   // get rootnode

  addnewportinfotag(cur,doc);  // this routine adds new portid, scannedby and servicename tags to the xmlfile created

  cur …
Run Code Online (Sandbox Code Playgroud)

c

0
推荐指数
1
解决办法
5014
查看次数

标签 统计

c ×1