<?xml version="1.0" encoding="GB2312"?>
<Body>
<Head fsfid="" jsfid="" sjblx="" scsj="20130815040000" jls="0010"/>
<Data>
<Item objectid="000232132400100" pollutant_code="CurDate" value="2013-08-15" equip_status="N"/>
<Item objectid="000232132400100" pollutant_code="CurTime" value="04:00:00" equip_status="N"/>
<Item objectid="000232132400100" pollutant_code="SO2" value="0.0438" equip_status="N" unit="mg/m3"/>
<Item objectid="000232132400100" pollutant_code="NO" value="0.0048" equip_status="N" unit="mg/m3"/>
<Item objectid="000232132400100" pollutant_code="NOX" value="0.0296" equip_status="N" unit="mg/m3"/>
<Item objectid="000232132400100" pollutant_code="NO2" value="0.0248" equip_status="N" unit="mg/m3"/>
<Item objectid="000232132400100" pollutant_code="PM10" value="0.0593" equip_status="N" unit="mg/m3"/>
<Item objectid="000232132400100" pollutant_code="TEMP" value="19.3" equip_status="N" unit="C"/>
<Item objectid="000232132400100" pollutant_code="RH" value="55.0" equip_status="N" unit="%"/>
<Item objectid="000232132400100" pollutant_code="BP" value="99.8" equip_status="N" unit="Kpa"/>
<Item objectid="000232132400100" pollutant_code="WD" value="196" equip_status="N" unit="deg"/>
<Item objectid="000232132400100" pollutant_code="WS" value="3.8" equip_status="N" unit="m/s"/>
</Data>
</Body>#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>void  parseStory (xmlDocPtr doc, xmlNodePtr cur) {   
xmlChar * key;
cur = cur->xmlChildrenNode; 
while (cur != NULL) {      
if ((!xmlStrcmp(cur->name, (const xmlChar *)"Item"))) {       
key = xmlNodeGetContent(cur); 
//key = xmlGetProp(cur,(const xmlChar*)"Item");  
printf("keyword: %s\n", key);       
xmlFree(key);       
}

cur = cur->next;  

      
return; 
}
static void  parseDoc(char *docname) {
  xmlDocPtr doc;  
xmlNodePtr cur;   
doc = xmlParseFile(docname);   
if (doc == NULL ) { 
fprintf(stderr,"Document not parsed successfully. \n");   
return;  


cur = xmlDocGetRootElement(doc);

if(cur == NULL){
fprintf(stderr,"empty document\n");
xmlFreeDoc(doc);
return;
}

if(xmlStrcmp(cur->name, (const xmlChar *) "Body")){
fprintf(stderr,"document of the wrong type, root node != Story");
xmlFreeDoc(doc);   
return;
} cur = cur->xmlChildrenNode;
while(cur != NULL){
if((!xmlStrcmp(cur->name,(const xmlChar*)"Data"))){
parseStory(doc,cur);
}
cur = cur->next;
} xmlFreeDoc(doc);
return;
}int main(int argc, char** argv){

char *docname; if(argc <= 1){
printf("Usage: %s docname\n", argv[0]);
} docname = argv[1];
parseDoc(docname);
return(1);
}请高人帮忙看看  编译没有问题 但是执行的时候输出的都都是keyword = 后面都是空白 请问这是为什么? xml