Bump copyright year
[yaz-moved-to-github.git] / test / tstsoap1.c
1 /* This file is part of the YAZ toolkit.
2  * Copyright (C) 1995-2010 Index Data
3  * See the file LICENSE for details.
4  */
5
6 #include <stdlib.h>
7 #if YAZ_HAVE_XML2
8 #include <libxml/parser.h>
9 #endif
10 #include <yaz/test.h>
11
12 void tst(void)
13 {
14 #if YAZ_HAVE_XML2
15     xmlChar *buf_out;
16     int len_out;
17     xmlDocPtr doc;
18     xmlNodePtr top;
19 #if 0
20     const char *val = "jordb" "\xe6" "r"; /* makes xmlDocDumpMemory hang .. */
21 #else
22     const char *val = "jordbaer"; /* OK */
23 #endif
24     doc = xmlNewDoc(BAD_CAST "1.0");
25     YAZ_CHECK(doc);
26
27     top = xmlNewNode(0, BAD_CAST "top");
28     YAZ_CHECK(top);
29     
30     xmlNewTextChild(top, 0, BAD_CAST "sub", BAD_CAST val);
31     xmlDocSetRootElement(doc, top);
32     
33     xmlDocDumpMemory(doc, &buf_out, &len_out);
34 #if 0
35     printf("%*s", len_out, buf_out);
36 #endif
37
38
39 /* YAZ_HAVE_XML2 */
40 #endif
41 }
42
43 int main(int argc, char **argv)
44 {
45     YAZ_CHECK_INIT(argc, argv);
46 #if YAZ_HAVE_XML2
47     LIBXML_TEST_VERSION;
48 #endif
49     tst();
50     YAZ_CHECK_TERM;
51 }
52
53
54 /*
55  * Local variables:
56  * c-basic-offset: 4
57  * c-file-style: "Stroustrup"
58  * indent-tabs-mode: nil
59  * End:
60  * vim: shiftwidth=4 tabstop=8 expandtab
61  */
62