For Libxml2 and friends, YAZ defines YAZ_HAVE_{XML2,XSLT,EXSLT) in
[yaz-moved-to-github.git] / test / nfaxmltest1.c
1 /*  Copyright (C) 2006, Index Data ApS
2  *  See the file LICENSE for details.
3  *
4  *  $Id: nfaxmltest1.c,v 1.2 2006-07-06 10:17:55 adam Exp $
5  *
6  */
7
8
9 #include <stdio.h>
10 #include <string.h>
11 #include <yaz/nfa.h>
12 #include <yaz/nmem.h>
13 #include <yaz/test.h>
14 #include <yaz/nfaxml.h>
15
16 #if YAZ_HAVE_XML2
17 #include <libxml/parser.h>
18
19
20 void test1() {
21     char *xmlstr="<ruleset> "
22                  "<rule> "
23                  "  <fromstring>foo</fromstring> "
24                  "  <tostring>bar</tostring> "
25                  "</rule>"
26                  "</ruleset>";
27     xmlDocPtr doc = xmlParseMemory(xmlstr, strlen(xmlstr));
28     YAZ_CHECK(doc);
29     if (!doc)
30         return;
31 }
32
33 int main(int argc, char **argv)
34 {
35     YAZ_CHECK_INIT(argc, argv);
36     nmem_init ();
37
38     test1();
39
40     nmem_exit ();
41     YAZ_CHECK_TERM;
42 }
43
44 #else
45 int main(int argc, char **argv) {
46     YAZ_CHECK_INIT(argc, argv);
47     YAZ_CHECK_TERM;
48 }
49
50 #endif
51
52 /* 
53  * Local variables:
54  * c-basic-offset: 4
55  * indent-tabs-mode: nil
56  * End:
57  * vim: shiftwidth=4 tabstop=8 expandtab
58  */