- xmlNodePtr top = xmlNewNode(0, "top");
-
- xmlNewTextChild(top, 0, "sub", val);
- xmlDocSetRootElement(doc, top);
-
- xmlDocDumpMemory(doc, &buf_out, &len_out);
- printf("%*s", len_out, buf_out);
- }
+ doc = xmlNewDoc(BAD_CAST "1.0");
+ YAZ_CHECK(doc);
+
+ top = xmlNewNode(0, BAD_CAST "top");
+ YAZ_CHECK(top);
+
+ xmlNewTextChild(top, 0, BAD_CAST "sub", BAD_CAST val);
+ xmlDocSetRootElement(doc, top);
+
+ xmlDocDumpMemory(doc, &buf_out, &len_out);
+#if 0
+ printf("%*s", len_out, buf_out);
+#endif
+
+
+/* YAZ_HAVE_XML2 */