我有这个代码
if(genericPtr->type == XML_ATTRIBUTE_NODE){
xmlAttrPtr attr = (xmlAttrPtr)genericPtr;
printf("\n str %s\n", (const char *)attr->children->content);
}
xmlBufferPtr bufferPtr = xmlBufferCreate();
if (IsXmlNsPtr(genericPtr)){
xmlNodeDump(bufferPtr, NULL, (xmlNodePtr)genericPtr, 0, format);
}else{
xmlNodeDump(bufferPtr, ((xmlStdPtr)genericPtr)->doc, (xmlNodePtr)genericPtr, 0, format);
}
printf("\n str2 %s\n", (const char *)bufferPtr->content);
结果是
str чатрум@muc.chat.quickblox.com/300
str2 to="чатрум@muc.chat.quickblox.com/300"
结果我需要чатрум
чатрум
我怎样才能做到这一点?