I think xml_print_node has some problem in processing empy attribute, e.g. <x attributeA= “” … /x>, here attributeA has an empty value
So in code
/* Attribute name. */
pj_memcpy(p, attr->name.ptr, attr->name.slen);
p += attr->name.slen;
/* Attribute value. */
if (attr->value.slen) {
*p++ = '=';
*p++ = '"';
pj_memcpy(p, attr->value.ptr, attr->value.slen);
p += attr->value.slen;
*p++ = '"';
}
if attr->value.slen == 0, i.e. empty attribute value, then it will print as <x attributeA … > this then become an invalid xml string!
I think the check if (attr->value.slen) is unnecessary because if it is 0, pj_memcpy(p, attr->value.ptr, attr->value.slen); is no-op so no harm here. But the result will become valid now, i.e. <x attributeA =“" … >
_______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@xxxxxxxxxxxxxxx http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org