2012-12-07 33 views

回答

1

libxml API docs似乎是合理的,並建議xmlBufGetNodeContentxmlBufContent可能會做你想做的。

xmlNode node1, node2; 
...... 
xmlBuf buf; 
xmlChar* content1 = NULL; 
xmlChar* content2 = NULL; 
if (xmlBufGetNodeContent(&buf, &node1) == 0) { 
    content1 = xmlBufContent(&buf); 
} 
if (xmlBufGetNodeContent(&buf, &node2) == 0) { 
    content2 = xmlBufContent(&buf); 
} 
if (strcmp(content1, content2) == 0) { 
    /* nodes match */ 
}