libxml自定義了一個字符類型xmlChar,其本質是 unsigned char.
另外,libxml提供了一個宏來將char*轉換成xmlChar*, 名字很有趣,叫 BAD_CAST 它的本質其實是 unsigned char*.
爲了方便對xmlChar類型字符串的操作,libxml提供了自己的函數,它們的定義於標準c函數庫中的字符串函數很像.
xmlChar* xmlStrcat (xmlChar *cur, const xmlChar * add)
const xmlChar *xmlStrchr(const xmlChar * str, xmlChar val)
int xmlStrcmp (const xmlChar * str1, const xmlChar * str2)
int xmlStrlen (const xmlChar * str)
xmlChar *xmlStrncat (xmlChar * cur, const xmlChar * add, int len)
int xmlStrncmp (const xmlChar * str1, const xmlChar * str2, int len)
const xmlChar *xmlStrstr (const xmlChar * str, const xmlChar * val)
相信這些函數大家都看得眼熟,這裏就不一一解釋了.
更多函數大家可以參考
http://xmlsoft.org/html/libxml-xmlstring.html