gtksourceview2 1.2.1-x86-mingw32 → 1.2.2-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (159) hide show
  1. data/lib/1.9/gtksourceview2.so +0 -0
  2. data/lib/2.0/gtksourceview2.so +0 -0
  3. metadata +452 -628
  4. data/lib/1.8/gtksourceview2.so +0 -0
  5. data/vendor/local/manifest/libxml2-dev_2.7.7-1_win32.mft +0 -267
  6. data/vendor/local/manifest/libxml2_2.7.7-1_win32.mft +0 -2
  7. data/vendor/local/share/doc/libxml2-2.7.7/Copyright +0 -27
  8. data/vendor/local/share/doc/libxml2-2.7.7/examples/testHTML.c +0 -880
  9. data/vendor/local/share/doc/libxml2-2.7.7/examples/testSAX.c +0 -1198
  10. data/vendor/local/share/doc/libxml2-2.7.7/examples/testXPath.c +0 -227
  11. data/vendor/local/share/doc/libxml2-2.7.7/examples/xmllint.c +0 -3722
  12. data/vendor/local/share/doc/libxml2-2.7.7/html/DOM.gif +0 -0
  13. data/vendor/local/share/doc/libxml2-2.7.7/html/FAQ.html +0 -282
  14. data/vendor/local/share/doc/libxml2-2.7.7/html/Libxml2-Logo-180x168.gif +0 -0
  15. data/vendor/local/share/doc/libxml2-2.7.7/html/Libxml2-Logo-90x34.gif +0 -0
  16. data/vendor/local/share/doc/libxml2-2.7.7/html/encoding.html +0 -206
  17. data/vendor/local/share/doc/libxml2-2.7.7/html/examples.xml +0 -751
  18. data/vendor/local/share/doc/libxml2-2.7.7/html/examples.xsl +0 -174
  19. data/vendor/local/share/doc/libxml2-2.7.7/html/html/book1.html +0 -13
  20. data/vendor/local/share/doc/libxml2-2.7.7/html/html/home.png +0 -0
  21. data/vendor/local/share/doc/libxml2-2.7.7/html/html/index.html +0 -13
  22. data/vendor/local/share/doc/libxml2-2.7.7/html/html/left.png +0 -0
  23. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-DOCBparser.html +0 -51
  24. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-HTMLparser.html +0 -182
  25. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-HTMLtree.html +0 -73
  26. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-SAX.html +0 -125
  27. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-SAX2.html +0 -128
  28. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-c14n.html +0 -38
  29. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-catalog.html +0 -142
  30. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-chvalid.html +0 -72
  31. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-debugXML.html +0 -120
  32. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-dict.html +0 -49
  33. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-encoding.html +0 -118
  34. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-entities.html +0 -79
  35. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-globals.html +0 -152
  36. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-hash.html +0 -116
  37. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-lib.html +0 -13
  38. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-list.html +0 -120
  39. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-nanoftp.html +0 -92
  40. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-nanohttp.html +0 -65
  41. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-parser.html +0 -555
  42. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-parserInternals.html +0 -319
  43. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-pattern.html +0 -76
  44. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-relaxng.html +0 -162
  45. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-schemasInternals.html +0 -373
  46. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-schematron.html +0 -81
  47. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-threads.html +0 -72
  48. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-tree.html +0 -958
  49. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-uri.html +0 -73
  50. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-valid.html +0 -289
  51. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xinclude.html +0 -59
  52. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xlink.html +0 -82
  53. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlIO.html +0 -206
  54. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlautomata.html +0 -85
  55. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlerror.html +0 -862
  56. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlexports.html +0 -20
  57. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlmemory.html +0 -107
  58. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlmodule.html +0 -38
  59. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlreader.html +0 -327
  60. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlregexp.html +0 -143
  61. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlsave.html +0 -59
  62. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlschemas.html +0 -173
  63. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlschemastypes.html +0 -123
  64. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlstring.html +0 -108
  65. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlunicode.html +0 -512
  66. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlversion.html +0 -60
  67. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlwriter.html +0 -258
  68. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xpath.html +0 -307
  69. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xpathInternals.html +0 -394
  70. data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xpointer.html +0 -83
  71. data/vendor/local/share/doc/libxml2-2.7.7/html/html/right.png +0 -0
  72. data/vendor/local/share/doc/libxml2-2.7.7/html/html/up.png +0 -0
  73. data/vendor/local/share/doc/libxml2-2.7.7/html/io1.c +0 -166
  74. data/vendor/local/share/doc/libxml2-2.7.7/html/io1.res +0 -5
  75. data/vendor/local/share/doc/libxml2-2.7.7/html/io2.c +0 -58
  76. data/vendor/local/share/doc/libxml2-2.7.7/html/io2.res +0 -2
  77. data/vendor/local/share/doc/libxml2-2.7.7/html/libxml.gif +0 -0
  78. data/vendor/local/share/doc/libxml2-2.7.7/html/parse1.c +0 -56
  79. data/vendor/local/share/doc/libxml2-2.7.7/html/parse2.c +0 -72
  80. data/vendor/local/share/doc/libxml2-2.7.7/html/parse3.c +0 -60
  81. data/vendor/local/share/doc/libxml2-2.7.7/html/parse4.c +0 -143
  82. data/vendor/local/share/doc/libxml2-2.7.7/html/reader1.c +0 -107
  83. data/vendor/local/share/doc/libxml2-2.7.7/html/reader1.res +0 -14
  84. data/vendor/local/share/doc/libxml2-2.7.7/html/reader2.c +0 -122
  85. data/vendor/local/share/doc/libxml2-2.7.7/html/reader3.c +0 -120
  86. data/vendor/local/share/doc/libxml2-2.7.7/html/reader3.res +0 -13
  87. data/vendor/local/share/doc/libxml2-2.7.7/html/reader4.c +0 -122
  88. data/vendor/local/share/doc/libxml2-2.7.7/html/reader4.res +0 -3
  89. data/vendor/local/share/doc/libxml2-2.7.7/html/redhat.gif +0 -0
  90. data/vendor/local/share/doc/libxml2-2.7.7/html/smallfootonly.gif +0 -0
  91. data/vendor/local/share/doc/libxml2-2.7.7/html/structure.gif +0 -0
  92. data/vendor/local/share/doc/libxml2-2.7.7/html/test1.xml +0 -1
  93. data/vendor/local/share/doc/libxml2-2.7.7/html/test2.xml +0 -13
  94. data/vendor/local/share/doc/libxml2-2.7.7/html/test3.xml +0 -39
  95. data/vendor/local/share/doc/libxml2-2.7.7/html/testWriter.c +0 -1198
  96. data/vendor/local/share/doc/libxml2-2.7.7/html/tree1.c +0 -94
  97. data/vendor/local/share/doc/libxml2-2.7.7/html/tree1.res +0 -4
  98. data/vendor/local/share/doc/libxml2-2.7.7/html/tree2.c +0 -118
  99. data/vendor/local/share/doc/libxml2-2.7.7/html/tree2.res +0 -18
  100. data/vendor/local/share/doc/libxml2-2.7.7/html/tst.xml +0 -7
  101. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/apa.html +0 -8
  102. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/apb.html +0 -14
  103. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/apc.html +0 -82
  104. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/apd.html +0 -76
  105. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/ape.html +0 -78
  106. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/apf.html +0 -67
  107. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/apg.html +0 -75
  108. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/aph.html +0 -76
  109. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/api.html +0 -4
  110. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s02.html +0 -14
  111. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s03.html +0 -47
  112. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s04.html +0 -54
  113. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s05.html +0 -55
  114. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s06.html +0 -35
  115. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s07.html +0 -30
  116. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s08.html +0 -38
  117. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s09.html +0 -63
  118. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/blank.png +0 -0
  119. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/1.png +0 -0
  120. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/10.png +0 -0
  121. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/2.png +0 -0
  122. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/3.png +0 -0
  123. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/4.png +0 -0
  124. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/5.png +0 -0
  125. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/6.png +0 -0
  126. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/7.png +0 -0
  127. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/8.png +0 -0
  128. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/9.png +0 -0
  129. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/caution.png +0 -0
  130. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/draft.png +0 -0
  131. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/home.png +0 -0
  132. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/important.png +0 -0
  133. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/next.png +0 -0
  134. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/note.png +0 -0
  135. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/prev.png +0 -0
  136. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/tip.png +0 -0
  137. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/toc-blank.png +0 -0
  138. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/toc-minus.png +0 -0
  139. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/toc-plus.png +0 -0
  140. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/up.png +0 -0
  141. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/warning.png +0 -0
  142. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/includeaddattribute.c +0 -64
  143. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/includeaddkeyword.c +0 -75
  144. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/includeconvert.c +0 -73
  145. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/includegetattribute.c +0 -72
  146. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/includekeyword.c +0 -79
  147. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/includexpath.c +0 -74
  148. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/index.html +0 -14
  149. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/ix01.html +0 -1
  150. data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/xmltutorial.pdf +0 -1336
  151. data/vendor/local/share/doc/libxml2-2.7.7/html/w3c.png +0 -0
  152. data/vendor/local/share/doc/libxml2-2.7.7/html/writer.xml +0 -2
  153. data/vendor/local/share/doc/libxml2-2.7.7/html/xml.html +0 -5344
  154. data/vendor/local/share/doc/libxml2-2.7.7/html/xpath1.c +0 -250
  155. data/vendor/local/share/doc/libxml2-2.7.7/html/xpath1.res +0 -5
  156. data/vendor/local/share/doc/libxml2-2.7.7/html/xpath2.c +0 -190
  157. data/vendor/local/share/doc/libxml2-2.7.7/html/xpath2.res +0 -30
  158. data/vendor/local/src/tml/packaging/libxml2_2.7.7-1_win32.log +0 -1244
  159. data/vendor/local/src/tml/packaging/libxml2_2.7.7-1_win32.sh +0 -66
@@ -1,107 +0,0 @@
1
- /**
2
- * section: xmlReader
3
- * synopsis: Parse an XML file with an xmlReader
4
- * purpose: Demonstrate the use of xmlReaderForFile() to parse an XML file
5
- * and dump the informations about the nodes found in the process.
6
- * (Note that the XMLReader functions require libxml2 version later
7
- * than 2.6.)
8
- * usage: reader1 <filename>
9
- * test: reader1 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp
10
- * author: Daniel Veillard
11
- * copy: see Copyright for the status of this software.
12
- */
13
-
14
- #include <stdio.h>
15
- #include <libxml/xmlreader.h>
16
-
17
- #ifdef LIBXML_READER_ENABLED
18
-
19
- /**
20
- * processNode:
21
- * @reader: the xmlReader
22
- *
23
- * Dump information about the current node
24
- */
25
- static void
26
- processNode(xmlTextReaderPtr reader) {
27
- const xmlChar *name, *value;
28
-
29
- name = xmlTextReaderConstName(reader);
30
- if (name == NULL)
31
- name = BAD_CAST "--";
32
-
33
- value = xmlTextReaderConstValue(reader);
34
-
35
- printf("%d %d %s %d %d",
36
- xmlTextReaderDepth(reader),
37
- xmlTextReaderNodeType(reader),
38
- name,
39
- xmlTextReaderIsEmptyElement(reader),
40
- xmlTextReaderHasValue(reader));
41
- if (value == NULL)
42
- printf("\n");
43
- else {
44
- if (xmlStrlen(value) > 40)
45
- printf(" %.40s...\n", value);
46
- else
47
- printf(" %s\n", value);
48
- }
49
- }
50
-
51
- /**
52
- * streamFile:
53
- * @filename: the file name to parse
54
- *
55
- * Parse and print information about an XML file.
56
- */
57
- static void
58
- streamFile(const char *filename) {
59
- xmlTextReaderPtr reader;
60
- int ret;
61
-
62
- reader = xmlReaderForFile(filename, NULL, 0);
63
- if (reader != NULL) {
64
- ret = xmlTextReaderRead(reader);
65
- while (ret == 1) {
66
- processNode(reader);
67
- ret = xmlTextReaderRead(reader);
68
- }
69
- xmlFreeTextReader(reader);
70
- if (ret != 0) {
71
- fprintf(stderr, "%s : failed to parse\n", filename);
72
- }
73
- } else {
74
- fprintf(stderr, "Unable to open %s\n", filename);
75
- }
76
- }
77
-
78
- int main(int argc, char **argv) {
79
- if (argc != 2)
80
- return(1);
81
-
82
- /*
83
- * this initialize the library and check potential ABI mismatches
84
- * between the version it was compiled for and the actual shared
85
- * library used.
86
- */
87
- LIBXML_TEST_VERSION
88
-
89
- streamFile(argv[1]);
90
-
91
- /*
92
- * Cleanup function for the XML library.
93
- */
94
- xmlCleanupParser();
95
- /*
96
- * this is to debug memory for regression tests
97
- */
98
- xmlMemoryDump();
99
- return(0);
100
- }
101
-
102
- #else
103
- int main(void) {
104
- fprintf(stderr, "XInclude support not compiled in\n");
105
- exit(1);
106
- }
107
- #endif
@@ -1,14 +0,0 @@
1
- 0 10 doc 0 0
2
- 0 1 doc 0 0
3
- 1 14 #text 0 1
4
-
5
- 1 1 src 1 0
6
- 1 14 #text 0 1
7
-
8
- 1 1 dest 1 0
9
- 1 14 #text 0 1
10
-
11
- 1 1 src 1 0
12
- 1 14 #text 0 1
13
-
14
- 0 15 doc 0 0
@@ -1,122 +0,0 @@
1
- /**
2
- * section: xmlReader
3
- * synopsis: Parse and validate an XML file with an xmlReader
4
- * purpose: Demonstrate the use of xmlReaderForFile() to parse an XML file
5
- * validating the content in the process and activating options
6
- * like entities substitution, and DTD attributes defaulting.
7
- * (Note that the XMLReader functions require libxml2 version later
8
- * than 2.6.)
9
- * usage: reader2 <valid_xml_filename>
10
- * test: reader2 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp
11
- * author: Daniel Veillard
12
- * copy: see Copyright for the status of this software.
13
- */
14
-
15
- #include <stdio.h>
16
- #include <libxml/xmlreader.h>
17
-
18
- #ifdef LIBXML_READER_ENABLED
19
-
20
- /**
21
- * processNode:
22
- * @reader: the xmlReader
23
- *
24
- * Dump information about the current node
25
- */
26
- static void
27
- processNode(xmlTextReaderPtr reader) {
28
- const xmlChar *name, *value;
29
-
30
- name = xmlTextReaderConstName(reader);
31
- if (name == NULL)
32
- name = BAD_CAST "--";
33
-
34
- value = xmlTextReaderConstValue(reader);
35
-
36
- printf("%d %d %s %d %d",
37
- xmlTextReaderDepth(reader),
38
- xmlTextReaderNodeType(reader),
39
- name,
40
- xmlTextReaderIsEmptyElement(reader),
41
- xmlTextReaderHasValue(reader));
42
- if (value == NULL)
43
- printf("\n");
44
- else {
45
- if (xmlStrlen(value) > 40)
46
- printf(" %.40s...\n", value);
47
- else
48
- printf(" %s\n", value);
49
- }
50
- }
51
-
52
- /**
53
- * streamFile:
54
- * @filename: the file name to parse
55
- *
56
- * Parse, validate and print information about an XML file.
57
- */
58
- static void
59
- streamFile(const char *filename) {
60
- xmlTextReaderPtr reader;
61
- int ret;
62
-
63
-
64
- /*
65
- * Pass some special parsing options to activate DTD attribute defaulting,
66
- * entities substitution and DTD validation
67
- */
68
- reader = xmlReaderForFile(filename, NULL,
69
- XML_PARSE_DTDATTR | /* default DTD attributes */
70
- XML_PARSE_NOENT | /* substitute entities */
71
- XML_PARSE_DTDVALID); /* validate with the DTD */
72
- if (reader != NULL) {
73
- ret = xmlTextReaderRead(reader);
74
- while (ret == 1) {
75
- processNode(reader);
76
- ret = xmlTextReaderRead(reader);
77
- }
78
- /*
79
- * Once the document has been fully parsed check the validation results
80
- */
81
- if (xmlTextReaderIsValid(reader) != 1) {
82
- fprintf(stderr, "Document %s does not validate\n", filename);
83
- }
84
- xmlFreeTextReader(reader);
85
- if (ret != 0) {
86
- fprintf(stderr, "%s : failed to parse\n", filename);
87
- }
88
- } else {
89
- fprintf(stderr, "Unable to open %s\n", filename);
90
- }
91
- }
92
-
93
- int main(int argc, char **argv) {
94
- if (argc != 2)
95
- return(1);
96
-
97
- /*
98
- * this initialize the library and check potential ABI mismatches
99
- * between the version it was compiled for and the actual shared
100
- * library used.
101
- */
102
- LIBXML_TEST_VERSION
103
-
104
- streamFile(argv[1]);
105
-
106
- /*
107
- * Cleanup function for the XML library.
108
- */
109
- xmlCleanupParser();
110
- /*
111
- * this is to debug memory for regression tests
112
- */
113
- xmlMemoryDump();
114
- return(0);
115
- }
116
-
117
- #else
118
- int main(void) {
119
- fprintf(stderr, "XInclude support not compiled in\n");
120
- exit(1);
121
- }
122
- #endif
@@ -1,120 +0,0 @@
1
- /**
2
- * section: xmlReader
3
- * synopsis: Show how to extract subdocuments with xmlReader
4
- * purpose: Demonstrate the use of xmlTextReaderPreservePattern()
5
- * to parse an XML file with the xmlReader while collecting
6
- * only some subparts of the document.
7
- * (Note that the XMLReader functions require libxml2 version later
8
- * than 2.6.)
9
- * usage: reader3
10
- * test: reader3 > reader3.tmp ; diff reader3.tmp reader3.res ; rm reader3.tmp
11
- * author: Daniel Veillard
12
- * copy: see Copyright for the status of this software.
13
- */
14
-
15
- #include <stdio.h>
16
- #include <libxml/xmlreader.h>
17
-
18
- #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
19
-
20
-
21
- /**
22
- * streamFile:
23
- * @filename: the file name to parse
24
- *
25
- * Parse and print information about an XML file.
26
- *
27
- * Returns the resulting doc with just the elements preserved.
28
- */
29
- static xmlDocPtr
30
- extractFile(const char *filename, const xmlChar *pattern) {
31
- xmlDocPtr doc;
32
- xmlTextReaderPtr reader;
33
- int ret;
34
-
35
- /*
36
- * build an xmlReader for that file
37
- */
38
- reader = xmlReaderForFile(filename, NULL, 0);
39
- if (reader != NULL) {
40
- /*
41
- * add the pattern to preserve
42
- */
43
- if (xmlTextReaderPreservePattern(reader, pattern, NULL) < 0) {
44
- fprintf(stderr, "%s : failed add preserve pattern %s\n",
45
- filename, (const char *) pattern);
46
- }
47
- /*
48
- * Parse and traverse the tree, collecting the nodes in the process
49
- */
50
- ret = xmlTextReaderRead(reader);
51
- while (ret == 1) {
52
- ret = xmlTextReaderRead(reader);
53
- }
54
- if (ret != 0) {
55
- fprintf(stderr, "%s : failed to parse\n", filename);
56
- xmlFreeTextReader(reader);
57
- return(NULL);
58
- }
59
- /*
60
- * get the resulting nodes
61
- */
62
- doc = xmlTextReaderCurrentDoc(reader);
63
- /*
64
- * Free up the reader
65
- */
66
- xmlFreeTextReader(reader);
67
- } else {
68
- fprintf(stderr, "Unable to open %s\n", filename);
69
- return(NULL);
70
- }
71
- return(doc);
72
- }
73
-
74
- int main(int argc, char **argv) {
75
- const char *filename = "test3.xml";
76
- const char *pattern = "preserved";
77
- xmlDocPtr doc;
78
-
79
- if (argc == 3) {
80
- filename = argv[1];
81
- pattern = argv[2];
82
- }
83
-
84
- /*
85
- * this initialize the library and check potential ABI mismatches
86
- * between the version it was compiled for and the actual shared
87
- * library used.
88
- */
89
- LIBXML_TEST_VERSION
90
-
91
- doc = extractFile(filename, (const xmlChar *) pattern);
92
- if (doc != NULL) {
93
- /*
94
- * ouptut the result.
95
- */
96
- xmlDocDump(stdout, doc);
97
- /*
98
- * don't forget to free up the doc
99
- */
100
- xmlFreeDoc(doc);
101
- }
102
-
103
-
104
- /*
105
- * Cleanup function for the XML library.
106
- */
107
- xmlCleanupParser();
108
- /*
109
- * this is to debug memory for regression tests
110
- */
111
- xmlMemoryDump();
112
- return(0);
113
- }
114
-
115
- #else
116
- int main(void) {
117
- fprintf(stderr, "Reader, Pattern or output support not compiled in\n");
118
- exit(1);
119
- }
120
- #endif
@@ -1,13 +0,0 @@
1
- <?xml version="1.0"?>
2
- <doc><parent><preserved/><preserved>
3
- content1
4
- <child1/>
5
- <child2>content2</child2>
6
- <preserved>too</preserved>
7
- <child2>content3</child2>
8
- <preserved/>
9
- <child2>content4</child2>
10
- <preserved/>
11
- <child2>content5</child2>
12
- content6
13
- </preserved><preserved/><preserved/></parent></doc>
@@ -1,122 +0,0 @@
1
- /**
2
- * section: xmlReader
3
- * synopsis: Parse multiple XML files reusing an xmlReader
4
- * purpose: Demonstrate the use of xmlReaderForFile() and
5
- * xmlReaderNewFile to parse XML files while reusing the reader object
6
- * and parser context. (Note that the XMLReader functions require
7
- * libxml2 version later than 2.6.)
8
- * usage: reader4 <filename> [ filename ... ]
9
- * test: reader4 test1.xml test2.xml test3.xml > reader4.tmp ; diff reader4.tmp reader4.res ; rm reader4.tmp
10
- * author: Graham Bennett
11
- * copy: see Copyright for the status of this software.
12
- */
13
-
14
- #include <stdio.h>
15
- #include <libxml/xmlreader.h>
16
-
17
- #ifdef LIBXML_READER_ENABLED
18
-
19
- static void processDoc(xmlTextReaderPtr readerPtr) {
20
- int ret;
21
- xmlDocPtr docPtr;
22
- const xmlChar *URL;
23
-
24
- ret = xmlTextReaderRead(readerPtr);
25
- while (ret == 1) {
26
- ret = xmlTextReaderRead(readerPtr);
27
- }
28
-
29
- /*
30
- * One can obtain the document pointer to get insteresting
31
- * information about the document like the URL, but one must also
32
- * be sure to clean it up at the end (see below).
33
- */
34
- docPtr = xmlTextReaderCurrentDoc(readerPtr);
35
- if (NULL == docPtr) {
36
- fprintf(stderr, "failed to obtain document\n");
37
- return;
38
- }
39
-
40
- URL = docPtr->URL;
41
- if (NULL == URL) {
42
- fprintf(stderr, "Failed to obtain URL\n");
43
- }
44
-
45
- if (ret != 0) {
46
- fprintf(stderr, "%s: Failed to parse\n", URL);
47
- return;
48
- }
49
-
50
- printf("%s: Processed ok\n", (const char *)URL);
51
- }
52
-
53
- int main(int argc, char **argv) {
54
- xmlTextReaderPtr readerPtr;
55
- int i;
56
- xmlDocPtr docPtr;
57
-
58
- if (argc < 2)
59
- return(1);
60
-
61
- /*
62
- * this initialises the library and check potential ABI mismatches
63
- * between the version it was compiled for and the actual shared
64
- * library used.
65
- */
66
- LIBXML_TEST_VERSION
67
-
68
- /*
69
- * Create a new reader for the first file and process the
70
- * document.
71
- */
72
- readerPtr = xmlReaderForFile(argv[1], NULL, 0);
73
- if (NULL == readerPtr) {
74
- fprintf(stderr, "%s: failed to create reader\n", argv[1]);
75
- return(1);
76
- }
77
- processDoc(readerPtr);
78
-
79
- /*
80
- * The reader can be reused for subsequent files.
81
- */
82
- for (i=2; i < argc; ++i) {
83
- xmlReaderNewFile(readerPtr, argv[i], NULL, 0);
84
- if (NULL == readerPtr) {
85
- fprintf(stderr, "%s: failed to create reader\n", argv[i]);
86
- return(1);
87
- }
88
- processDoc(readerPtr);
89
- }
90
-
91
- /*
92
- * Since we've called xmlTextReaderCurrentDoc, we now have to
93
- * clean up after ourselves. We only have to do this the last
94
- * time, because xmlReaderNewFile calls xmlCtxtReset which takes
95
- * care of it.
96
- */
97
- docPtr = xmlTextReaderCurrentDoc(readerPtr);
98
- if (docPtr != NULL)
99
- xmlFreeDoc(docPtr);
100
-
101
- /*
102
- * Clean up the reader.
103
- */
104
- xmlFreeTextReader(readerPtr);
105
-
106
- /*
107
- * Cleanup function for the XML library.
108
- */
109
- xmlCleanupParser();
110
- /*
111
- * this is to debug memory for regression tests
112
- */
113
- xmlMemoryDump();
114
- return(0);
115
- }
116
-
117
- #else
118
- int main(void) {
119
- fprintf(stderr, "xmlReader support not compiled in\n");
120
- exit(1);
121
- }
122
- #endif