]> git.mxchange.org Git - flightgear.git/blob - utils/xmlgrep/README
29be06bb32e79ea88982c47c95a65f997b38e501
[flightgear.git] / utils / xmlgrep / README
1 #
2 # Functions to Open and Close the XML file
3 # e.g.
4 #   id = xmlOpen("/tmp/file.xml");
5 #   xmlClose(id);
6 #
7 void *xmlOpen(const char *);
8 void xmlClose(const void *);
9
10 #
11 # Get the Id of a node at the specified path
12 # e.g.
13 #    xnid = xmlGetNode(id, "/path/to/specified/node");
14 #
15 void *xmlGetNode(const void *, const char *);
16 void *xmlCopyNode(void *, const char *);
17
18 #
19 # Functions to walk the node tree an process them one by one.
20 # e.g.
21 #   xmid = xmlMarkId(id);
22 #   num = xmlGetNumElements(xmid);
23 #   for (i=0; i<num; i++) {
24 #      if (xmlGetNextElement(id, xmid, "element") != 0) {
25 #         if ((s = xmlGetString(xmid)) != 0) {
26 #            printf("%s\n", s);
27 #            free(s);
28 #         }
29 #      }
30 #   }
31 #
32 void *xmlMarkId(void *);
33 unsigned int xmlGetNumElements(void *, const char *);
34 void *xmlGetNextElement(const void *, void *, const char *);
35
36 #
37 # These functions work on the current node.
38 # e.g.
39 #    xnid = xmlGetNode(id, "/path/to/last/node");
40 #    i = xmlGetInt(xnid);
41 # or
42 #    xnid = xmlGetNode(id, "/path/to/specified/node");
43 #    if (xmlCompareString(xnid, "value") == 0) printf("We have a match!\n");
44 #
45 long int xmlGetInt(void *);
46 double xmlGetDouble(void *);
47 char *xmlGetString(void *);
48 int xmlCompareString(const void *, const char *);
49
50 #
51 # These functions work on a specified node path
52 # e.g.
53 #    d = xmlGetNodeDouble(id, "/path/to/node");
54 # or
55 #    xnid = xmlGetNode(id, "/path/to");
56 #    i = xmlGetNodeInt(xnid, "node");
57 #
58 long int xmlGetNodeInt(void *, const char *);
59 double xmlGetNodeDouble(void *, const char *);
60 char *xmlGetNodeString(void *, const char *);
61 unsigned xmlCopyNodeString(void *, const char *, char *, const unsigned int);
62 int xmlCompareNodeString(const void *, const char *, const char *);