strcat(indent, "··");
}
syslog(LOG_DEBUG, "%s<%s>", indent, el);
+ ++crp->tag_nesting_level;
+ indent[0] = 0;
+ for (i=0; i<crp->tag_nesting_level; ++i) {
+ strcat(indent, "··");
+ }
for (i = 0; attr[i] != NULL; i += 2) {
syslog(LOG_DEBUG, "%sAttribute '%s' = '%s'", indent, attr[i], attr[i + 1]);
}
crp->report_type = cr_freebusy_query;
}
- ++crp->tag_nesting_level;
}
memcpy(app, s, len);
app[len] = 0;
+ if (crp->Chardata == NULL) {
+ crp->Chardata = NewStrBuf();
+ }
+
+ StrBufAppendBufPlain(crp->Chardata, app, len, 0);
+
#ifdef DEBUG_XML_PARSE
// logging
- int i;
- char indent[256];
- indent[0] = 0;
- for (i=0; i<crp->tag_nesting_level; ++i) {
- strcat(indent, "··");
+ string_trim(app); // remove leading/trailing whitespace. ok to mangle it because we've already appended.
+ if (!IsEmptyStr(app)) {
+ int i;
+ char indent[256];
+ indent[0] = 0;
+ for (i=0; i<crp->tag_nesting_level; ++i) {
+ strcat(indent, "··");
+ }
+ syslog(LOG_DEBUG, "%s%s", indent, app, len);
}
- syslog(LOG_DEBUG, "%s%s", indent, app, len);
// end logging
#endif
- if (crp->Chardata == NULL) {
- crp->Chardata = NewStrBuf();
- }
-
- StrBufAppendBufPlain(crp->Chardata, app, len, 0);
free(app);
-
return;
}