+ int i;
+
+ for (i = 0; i<len; i++)
+ if (!strchr ("\n\n ", s[i]))
+ break;
+ if (i != len)
+ {
+ ui->d1_stack[ui->level] = data1_mk_text_n (ui->dh, ui->nmem, s, len,
+ ui->d1_stack[ui->level -1]);
+ }
+}
+
+static void cb_decl (void *user, const char *version, const char*encoding,
+ int standalone)
+{
+ printf ("decl version=%s encoding=%s\n", version ? version : "null",
+ encoding ? encoding : "null");
+}
+
+static void cb_processing (void *userData, const char *target,
+ const char *data)
+{
+ printf ("decl processing target=%s data=%s\n", target ? target : "null",
+ data ? data : "null");
+}
+
+static void cb_comment (void *userData, const char *data)
+{
+ printf ("decl comment data=%s\n", data ? data : "null");
+}
+
+static void cb_doctype_start (void *userData, const char *doctypeName,
+ const char *sysid, const char *pubid,
+ int has_internal_subset)
+{
+ printf ("doctype start doctype=%s sysid=%s pubid=%s\n",
+ doctypeName, sysid, pubid);
+}
+
+static void cb_doctype_end (void *userData)
+{
+ printf ("doctype end\n");
+}
+
+
+static void cb_entity_decl (void *userData, const char *entityName,
+ int is_parameter_entity,
+ const char *value, int value_length,
+ const char *base, const char *systemId,
+ const char *publicId, const char *notationName)
+{
+ printf ("entity %s is_para_entry=%d value=%.*s base=%s systemId=%s\n"
+ " publicId=%s notationName=%s\n",
+ entityName, is_parameter_entity, value_length, value,
+ base, systemId, publicId, notationName);
+