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.
- data/lib/1.9/gtksourceview2.so +0 -0
- data/lib/2.0/gtksourceview2.so +0 -0
- metadata +452 -628
- data/lib/1.8/gtksourceview2.so +0 -0
- data/vendor/local/manifest/libxml2-dev_2.7.7-1_win32.mft +0 -267
- data/vendor/local/manifest/libxml2_2.7.7-1_win32.mft +0 -2
- data/vendor/local/share/doc/libxml2-2.7.7/Copyright +0 -27
- data/vendor/local/share/doc/libxml2-2.7.7/examples/testHTML.c +0 -880
- data/vendor/local/share/doc/libxml2-2.7.7/examples/testSAX.c +0 -1198
- data/vendor/local/share/doc/libxml2-2.7.7/examples/testXPath.c +0 -227
- data/vendor/local/share/doc/libxml2-2.7.7/examples/xmllint.c +0 -3722
- data/vendor/local/share/doc/libxml2-2.7.7/html/DOM.gif +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/FAQ.html +0 -282
- data/vendor/local/share/doc/libxml2-2.7.7/html/Libxml2-Logo-180x168.gif +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/Libxml2-Logo-90x34.gif +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/encoding.html +0 -206
- data/vendor/local/share/doc/libxml2-2.7.7/html/examples.xml +0 -751
- data/vendor/local/share/doc/libxml2-2.7.7/html/examples.xsl +0 -174
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/book1.html +0 -13
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/home.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/index.html +0 -13
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/left.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-DOCBparser.html +0 -51
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-HTMLparser.html +0 -182
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-HTMLtree.html +0 -73
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-SAX.html +0 -125
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-SAX2.html +0 -128
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-c14n.html +0 -38
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-catalog.html +0 -142
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-chvalid.html +0 -72
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-debugXML.html +0 -120
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-dict.html +0 -49
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-encoding.html +0 -118
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-entities.html +0 -79
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-globals.html +0 -152
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-hash.html +0 -116
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-lib.html +0 -13
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-list.html +0 -120
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-nanoftp.html +0 -92
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-nanohttp.html +0 -65
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-parser.html +0 -555
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-parserInternals.html +0 -319
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-pattern.html +0 -76
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-relaxng.html +0 -162
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-schemasInternals.html +0 -373
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-schematron.html +0 -81
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-threads.html +0 -72
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-tree.html +0 -958
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-uri.html +0 -73
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-valid.html +0 -289
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xinclude.html +0 -59
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xlink.html +0 -82
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlIO.html +0 -206
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlautomata.html +0 -85
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlerror.html +0 -862
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlexports.html +0 -20
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlmemory.html +0 -107
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlmodule.html +0 -38
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlreader.html +0 -327
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlregexp.html +0 -143
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlsave.html +0 -59
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlschemas.html +0 -173
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlschemastypes.html +0 -123
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlstring.html +0 -108
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlunicode.html +0 -512
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlversion.html +0 -60
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlwriter.html +0 -258
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xpath.html +0 -307
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xpathInternals.html +0 -394
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/libxml-xpointer.html +0 -83
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/right.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/html/up.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/io1.c +0 -166
- data/vendor/local/share/doc/libxml2-2.7.7/html/io1.res +0 -5
- data/vendor/local/share/doc/libxml2-2.7.7/html/io2.c +0 -58
- data/vendor/local/share/doc/libxml2-2.7.7/html/io2.res +0 -2
- data/vendor/local/share/doc/libxml2-2.7.7/html/libxml.gif +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/parse1.c +0 -56
- data/vendor/local/share/doc/libxml2-2.7.7/html/parse2.c +0 -72
- data/vendor/local/share/doc/libxml2-2.7.7/html/parse3.c +0 -60
- data/vendor/local/share/doc/libxml2-2.7.7/html/parse4.c +0 -143
- data/vendor/local/share/doc/libxml2-2.7.7/html/reader1.c +0 -107
- data/vendor/local/share/doc/libxml2-2.7.7/html/reader1.res +0 -14
- data/vendor/local/share/doc/libxml2-2.7.7/html/reader2.c +0 -122
- data/vendor/local/share/doc/libxml2-2.7.7/html/reader3.c +0 -120
- data/vendor/local/share/doc/libxml2-2.7.7/html/reader3.res +0 -13
- data/vendor/local/share/doc/libxml2-2.7.7/html/reader4.c +0 -122
- data/vendor/local/share/doc/libxml2-2.7.7/html/reader4.res +0 -3
- data/vendor/local/share/doc/libxml2-2.7.7/html/redhat.gif +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/smallfootonly.gif +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/structure.gif +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/test1.xml +0 -1
- data/vendor/local/share/doc/libxml2-2.7.7/html/test2.xml +0 -13
- data/vendor/local/share/doc/libxml2-2.7.7/html/test3.xml +0 -39
- data/vendor/local/share/doc/libxml2-2.7.7/html/testWriter.c +0 -1198
- data/vendor/local/share/doc/libxml2-2.7.7/html/tree1.c +0 -94
- data/vendor/local/share/doc/libxml2-2.7.7/html/tree1.res +0 -4
- data/vendor/local/share/doc/libxml2-2.7.7/html/tree2.c +0 -118
- data/vendor/local/share/doc/libxml2-2.7.7/html/tree2.res +0 -18
- data/vendor/local/share/doc/libxml2-2.7.7/html/tst.xml +0 -7
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/apa.html +0 -8
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/apb.html +0 -14
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/apc.html +0 -82
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/apd.html +0 -76
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/ape.html +0 -78
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/apf.html +0 -67
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/apg.html +0 -75
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/aph.html +0 -76
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/api.html +0 -4
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s02.html +0 -14
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s03.html +0 -47
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s04.html +0 -54
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s05.html +0 -55
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s06.html +0 -35
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s07.html +0 -30
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s08.html +0 -38
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s09.html +0 -63
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/blank.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/1.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/10.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/2.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/3.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/4.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/5.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/6.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/7.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/8.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/9.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/caution.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/draft.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/home.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/important.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/next.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/note.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/prev.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/tip.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/toc-blank.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/toc-minus.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/toc-plus.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/up.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/images/warning.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/includeaddattribute.c +0 -64
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/includeaddkeyword.c +0 -75
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/includeconvert.c +0 -73
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/includegetattribute.c +0 -72
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/includekeyword.c +0 -79
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/includexpath.c +0 -74
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/index.html +0 -14
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/ix01.html +0 -1
- data/vendor/local/share/doc/libxml2-2.7.7/html/tutorial/xmltutorial.pdf +0 -1336
- data/vendor/local/share/doc/libxml2-2.7.7/html/w3c.png +0 -0
- data/vendor/local/share/doc/libxml2-2.7.7/html/writer.xml +0 -2
- data/vendor/local/share/doc/libxml2-2.7.7/html/xml.html +0 -5344
- data/vendor/local/share/doc/libxml2-2.7.7/html/xpath1.c +0 -250
- data/vendor/local/share/doc/libxml2-2.7.7/html/xpath1.res +0 -5
- data/vendor/local/share/doc/libxml2-2.7.7/html/xpath2.c +0 -190
- data/vendor/local/share/doc/libxml2-2.7.7/html/xpath2.res +0 -30
- data/vendor/local/src/tml/packaging/libxml2_2.7.7-1_win32.log +0 -1244
- data/vendor/local/src/tml/packaging/libxml2_2.7.7-1_win32.sh +0 -66
Binary file
|
Binary file
|
@@ -1,166 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* section: InputOutput
|
3
|
-
* synopsis: Example of custom Input/Output
|
4
|
-
* purpose: Demonstrate the use of xmlRegisterInputCallbacks
|
5
|
-
* to build a custom I/O layer, this is used in an
|
6
|
-
* XInclude method context to show how dynamic document can
|
7
|
-
* be built in a clean way.
|
8
|
-
* usage: io1
|
9
|
-
* test: io1 > io1.tmp ; diff io1.tmp io1.res ; rm -f io1.tmp
|
10
|
-
* author: Daniel Veillard
|
11
|
-
* copy: see Copyright for the status of this software.
|
12
|
-
*/
|
13
|
-
|
14
|
-
#include <stdio.h>
|
15
|
-
#include <string.h>
|
16
|
-
#include <libxml/parser.h>
|
17
|
-
#include <libxml/tree.h>
|
18
|
-
#include <libxml/xinclude.h>
|
19
|
-
#include <libxml/xmlIO.h>
|
20
|
-
|
21
|
-
#ifdef LIBXML_XINCLUDE_ENABLED
|
22
|
-
static const char *result = "<list><people>a</people><people>b</people></list>";
|
23
|
-
static const char *cur = NULL;
|
24
|
-
static int rlen;
|
25
|
-
|
26
|
-
/**
|
27
|
-
* sqlMatch:
|
28
|
-
* @URI: an URI to test
|
29
|
-
*
|
30
|
-
* Check for an sql: query
|
31
|
-
*
|
32
|
-
* Returns 1 if yes and 0 if another Input module should be used
|
33
|
-
*/
|
34
|
-
static int
|
35
|
-
sqlMatch(const char * URI) {
|
36
|
-
if ((URI != NULL) && (!strncmp(URI, "sql:", 4)))
|
37
|
-
return(1);
|
38
|
-
return(0);
|
39
|
-
}
|
40
|
-
|
41
|
-
/**
|
42
|
-
* sqlOpen:
|
43
|
-
* @URI: an URI to test
|
44
|
-
*
|
45
|
-
* Return a pointer to the sql: query handler, in this example simply
|
46
|
-
* the current pointer...
|
47
|
-
*
|
48
|
-
* Returns an Input context or NULL in case or error
|
49
|
-
*/
|
50
|
-
static void *
|
51
|
-
sqlOpen(const char * URI) {
|
52
|
-
if ((URI == NULL) || (strncmp(URI, "sql:", 4)))
|
53
|
-
return(NULL);
|
54
|
-
cur = result;
|
55
|
-
rlen = strlen(result);
|
56
|
-
return((void *) cur);
|
57
|
-
}
|
58
|
-
|
59
|
-
/**
|
60
|
-
* sqlClose:
|
61
|
-
* @context: the read context
|
62
|
-
*
|
63
|
-
* Close the sql: query handler
|
64
|
-
*
|
65
|
-
* Returns 0 or -1 in case of error
|
66
|
-
*/
|
67
|
-
static int
|
68
|
-
sqlClose(void * context) {
|
69
|
-
if (context == NULL) return(-1);
|
70
|
-
cur = NULL;
|
71
|
-
rlen = 0;
|
72
|
-
return(0);
|
73
|
-
}
|
74
|
-
|
75
|
-
/**
|
76
|
-
* sqlRead:
|
77
|
-
* @context: the read context
|
78
|
-
* @buffer: where to store data
|
79
|
-
* @len: number of bytes to read
|
80
|
-
*
|
81
|
-
* Implement an sql: query read.
|
82
|
-
*
|
83
|
-
* Returns the number of bytes read or -1 in case of error
|
84
|
-
*/
|
85
|
-
static int
|
86
|
-
sqlRead(void * context, char * buffer, int len) {
|
87
|
-
const char *ptr = (const char *) context;
|
88
|
-
|
89
|
-
if ((context == NULL) || (buffer == NULL) || (len < 0))
|
90
|
-
return(-1);
|
91
|
-
|
92
|
-
if (len > rlen) len = rlen;
|
93
|
-
memcpy(buffer, ptr, len);
|
94
|
-
rlen -= len;
|
95
|
-
return(len);
|
96
|
-
}
|
97
|
-
|
98
|
-
const char *include = "<?xml version='1.0'?>\n\
|
99
|
-
<document xmlns:xi=\"http://www.w3.org/2003/XInclude\">\n\
|
100
|
-
<p>List of people:</p>\n\
|
101
|
-
<xi:include href=\"sql:select_name_from_people\"/>\n\
|
102
|
-
</document>\n";
|
103
|
-
|
104
|
-
int main(void) {
|
105
|
-
xmlDocPtr doc;
|
106
|
-
|
107
|
-
/*
|
108
|
-
* this initialize the library and check potential ABI mismatches
|
109
|
-
* between the version it was compiled for and the actual shared
|
110
|
-
* library used.
|
111
|
-
*/
|
112
|
-
LIBXML_TEST_VERSION
|
113
|
-
|
114
|
-
/*
|
115
|
-
* register the new I/O handlers
|
116
|
-
*/
|
117
|
-
if (xmlRegisterInputCallbacks(sqlMatch, sqlOpen, sqlRead, sqlClose) < 0) {
|
118
|
-
fprintf(stderr, "failed to register SQL handler\n");
|
119
|
-
exit(1);
|
120
|
-
}
|
121
|
-
/*
|
122
|
-
* parse include into a document
|
123
|
-
*/
|
124
|
-
doc = xmlReadMemory(include, strlen(include), "include.xml", NULL, 0);
|
125
|
-
if (doc == NULL) {
|
126
|
-
fprintf(stderr, "failed to parse the including file\n");
|
127
|
-
exit(1);
|
128
|
-
}
|
129
|
-
|
130
|
-
/*
|
131
|
-
* apply the XInclude process, this should trigger the I/O just
|
132
|
-
* registered.
|
133
|
-
*/
|
134
|
-
if (xmlXIncludeProcess(doc) <= 0) {
|
135
|
-
fprintf(stderr, "XInclude processing failed\n");
|
136
|
-
exit(1);
|
137
|
-
}
|
138
|
-
|
139
|
-
#ifdef LIBXML_OUTPUT_ENABLED
|
140
|
-
/*
|
141
|
-
* save the output for checking to stdout
|
142
|
-
*/
|
143
|
-
xmlDocDump(stdout, doc);
|
144
|
-
#endif
|
145
|
-
|
146
|
-
/*
|
147
|
-
* Free the document
|
148
|
-
*/
|
149
|
-
xmlFreeDoc(doc);
|
150
|
-
|
151
|
-
/*
|
152
|
-
* Cleanup function for the XML library.
|
153
|
-
*/
|
154
|
-
xmlCleanupParser();
|
155
|
-
/*
|
156
|
-
* this is to debug memory for regression tests
|
157
|
-
*/
|
158
|
-
xmlMemoryDump();
|
159
|
-
return(0);
|
160
|
-
}
|
161
|
-
#else
|
162
|
-
int main(void) {
|
163
|
-
fprintf(stderr, "XInclude support not compiled in\n");
|
164
|
-
exit(1);
|
165
|
-
}
|
166
|
-
#endif
|
@@ -1,58 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* section: InputOutput
|
3
|
-
* synopsis: Output to char buffer
|
4
|
-
* purpose: Demonstrate the use of xmlDocDumpMemory
|
5
|
-
* to output document to a character buffer
|
6
|
-
* usage: io2
|
7
|
-
* test: io2 > io2.tmp ; diff io2.tmp io2.res ; rm -f io2.tmp
|
8
|
-
* author: John Fleck
|
9
|
-
* copy: see Copyright for the status of this software.
|
10
|
-
*/
|
11
|
-
|
12
|
-
#include <libxml/parser.h>
|
13
|
-
|
14
|
-
#if defined(LIBXML_TREE_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
|
15
|
-
int
|
16
|
-
main(void)
|
17
|
-
{
|
18
|
-
|
19
|
-
xmlNodePtr n;
|
20
|
-
xmlDocPtr doc;
|
21
|
-
xmlChar *xmlbuff;
|
22
|
-
int buffersize;
|
23
|
-
|
24
|
-
/*
|
25
|
-
* Create the document.
|
26
|
-
*/
|
27
|
-
doc = xmlNewDoc(BAD_CAST "1.0");
|
28
|
-
n = xmlNewNode(NULL, BAD_CAST "root");
|
29
|
-
xmlNodeSetContent(n, BAD_CAST "content");
|
30
|
-
xmlDocSetRootElement(doc, n);
|
31
|
-
|
32
|
-
/*
|
33
|
-
* Dump the document to a buffer and print it
|
34
|
-
* for demonstration purposes.
|
35
|
-
*/
|
36
|
-
xmlDocDumpFormatMemory(doc, &xmlbuff, &buffersize, 1);
|
37
|
-
printf("%s", (char *) xmlbuff);
|
38
|
-
|
39
|
-
/*
|
40
|
-
* Free associated memory.
|
41
|
-
*/
|
42
|
-
xmlFree(xmlbuff);
|
43
|
-
xmlFreeDoc(doc);
|
44
|
-
|
45
|
-
return (0);
|
46
|
-
|
47
|
-
}
|
48
|
-
#else
|
49
|
-
#include <stdio.h>
|
50
|
-
|
51
|
-
int
|
52
|
-
main(void)
|
53
|
-
{
|
54
|
-
fprintf(stderr,
|
55
|
-
"library not configured with tree and output support\n");
|
56
|
-
return (1);
|
57
|
-
}
|
58
|
-
#endif
|
Binary file
|
@@ -1,56 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* section: Parsing
|
3
|
-
* synopsis: Parse an XML file to a tree and free it
|
4
|
-
* purpose: Demonstrate the use of xmlReadFile() to read an XML file
|
5
|
-
* into a tree and and xmlFreeDoc() to free the resulting tree
|
6
|
-
* usage: parse1 test1.xml
|
7
|
-
* test: parse1 test1.xml
|
8
|
-
* author: Daniel Veillard
|
9
|
-
* copy: see Copyright for the status of this software.
|
10
|
-
*/
|
11
|
-
|
12
|
-
#include <stdio.h>
|
13
|
-
#include <libxml/parser.h>
|
14
|
-
#include <libxml/tree.h>
|
15
|
-
|
16
|
-
/**
|
17
|
-
* example1Func:
|
18
|
-
* @filename: a filename or an URL
|
19
|
-
*
|
20
|
-
* Parse the resource and free the resulting tree
|
21
|
-
*/
|
22
|
-
static void
|
23
|
-
example1Func(const char *filename) {
|
24
|
-
xmlDocPtr doc; /* the resulting document tree */
|
25
|
-
|
26
|
-
doc = xmlReadFile(filename, NULL, 0);
|
27
|
-
if (doc == NULL) {
|
28
|
-
fprintf(stderr, "Failed to parse %s\n", filename);
|
29
|
-
return;
|
30
|
-
}
|
31
|
-
xmlFreeDoc(doc);
|
32
|
-
}
|
33
|
-
|
34
|
-
int main(int argc, char **argv) {
|
35
|
-
if (argc != 2)
|
36
|
-
return(1);
|
37
|
-
|
38
|
-
/*
|
39
|
-
* this initialize the library and check potential ABI mismatches
|
40
|
-
* between the version it was compiled for and the actual shared
|
41
|
-
* library used.
|
42
|
-
*/
|
43
|
-
LIBXML_TEST_VERSION
|
44
|
-
|
45
|
-
example1Func(argv[1]);
|
46
|
-
|
47
|
-
/*
|
48
|
-
* Cleanup function for the XML library.
|
49
|
-
*/
|
50
|
-
xmlCleanupParser();
|
51
|
-
/*
|
52
|
-
* this is to debug memory for regression tests
|
53
|
-
*/
|
54
|
-
xmlMemoryDump();
|
55
|
-
return(0);
|
56
|
-
}
|
@@ -1,72 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* section: Parsing
|
3
|
-
* synopsis: Parse and validate an XML file to a tree and free the result
|
4
|
-
* purpose: Create a parser context for an XML file, then parse and validate
|
5
|
-
* the file, creating a tree, check the validation result
|
6
|
-
* and xmlFreeDoc() to free the resulting tree.
|
7
|
-
* usage: parse2 test2.xml
|
8
|
-
* test: parse2 test2.xml
|
9
|
-
* author: Daniel Veillard
|
10
|
-
* copy: see Copyright for the status of this software.
|
11
|
-
*/
|
12
|
-
|
13
|
-
#include <stdio.h>
|
14
|
-
#include <libxml/parser.h>
|
15
|
-
#include <libxml/tree.h>
|
16
|
-
|
17
|
-
/**
|
18
|
-
* exampleFunc:
|
19
|
-
* @filename: a filename or an URL
|
20
|
-
*
|
21
|
-
* Parse and validate the resource and free the resulting tree
|
22
|
-
*/
|
23
|
-
static void
|
24
|
-
exampleFunc(const char *filename) {
|
25
|
-
xmlParserCtxtPtr ctxt; /* the parser context */
|
26
|
-
xmlDocPtr doc; /* the resulting document tree */
|
27
|
-
|
28
|
-
/* create a parser context */
|
29
|
-
ctxt = xmlNewParserCtxt();
|
30
|
-
if (ctxt == NULL) {
|
31
|
-
fprintf(stderr, "Failed to allocate parser context\n");
|
32
|
-
return;
|
33
|
-
}
|
34
|
-
/* parse the file, activating the DTD validation option */
|
35
|
-
doc = xmlCtxtReadFile(ctxt, filename, NULL, XML_PARSE_DTDVALID);
|
36
|
-
/* check if parsing suceeded */
|
37
|
-
if (doc == NULL) {
|
38
|
-
fprintf(stderr, "Failed to parse %s\n", filename);
|
39
|
-
} else {
|
40
|
-
/* check if validation suceeded */
|
41
|
-
if (ctxt->valid == 0)
|
42
|
-
fprintf(stderr, "Failed to validate %s\n", filename);
|
43
|
-
/* free up the resulting document */
|
44
|
-
xmlFreeDoc(doc);
|
45
|
-
}
|
46
|
-
/* free up the parser context */
|
47
|
-
xmlFreeParserCtxt(ctxt);
|
48
|
-
}
|
49
|
-
|
50
|
-
int main(int argc, char **argv) {
|
51
|
-
if (argc != 2)
|
52
|
-
return(1);
|
53
|
-
|
54
|
-
/*
|
55
|
-
* this initialize the library and check potential ABI mismatches
|
56
|
-
* between the version it was compiled for and the actual shared
|
57
|
-
* library used.
|
58
|
-
*/
|
59
|
-
LIBXML_TEST_VERSION
|
60
|
-
|
61
|
-
exampleFunc(argv[1]);
|
62
|
-
|
63
|
-
/*
|
64
|
-
* Cleanup function for the XML library.
|
65
|
-
*/
|
66
|
-
xmlCleanupParser();
|
67
|
-
/*
|
68
|
-
* this is to debug memory for regression tests
|
69
|
-
*/
|
70
|
-
xmlMemoryDump();
|
71
|
-
return(0);
|
72
|
-
}
|
@@ -1,60 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* section: Parsing
|
3
|
-
* synopsis: Parse an XML document in memory to a tree and free it
|
4
|
-
* purpose: Demonstrate the use of xmlReadMemory() to read an XML file
|
5
|
-
* into a tree and and xmlFreeDoc() to free the resulting tree
|
6
|
-
* usage: parse3
|
7
|
-
* test: parse3
|
8
|
-
* author: Daniel Veillard
|
9
|
-
* copy: see Copyright for the status of this software.
|
10
|
-
*/
|
11
|
-
|
12
|
-
#include <stdio.h>
|
13
|
-
#include <libxml/parser.h>
|
14
|
-
#include <libxml/tree.h>
|
15
|
-
|
16
|
-
static const char *document = "<doc/>";
|
17
|
-
|
18
|
-
/**
|
19
|
-
* example3Func:
|
20
|
-
* @content: the content of the document
|
21
|
-
* @length: the length in bytes
|
22
|
-
*
|
23
|
-
* Parse the in memory document and free the resulting tree
|
24
|
-
*/
|
25
|
-
static void
|
26
|
-
example3Func(const char *content, int length) {
|
27
|
-
xmlDocPtr doc; /* the resulting document tree */
|
28
|
-
|
29
|
-
/*
|
30
|
-
* The document being in memory, it have no base per RFC 2396,
|
31
|
-
* and the "noname.xml" argument will serve as its base.
|
32
|
-
*/
|
33
|
-
doc = xmlReadMemory(content, length, "noname.xml", NULL, 0);
|
34
|
-
if (doc == NULL) {
|
35
|
-
fprintf(stderr, "Failed to parse document\n");
|
36
|
-
return;
|
37
|
-
}
|
38
|
-
xmlFreeDoc(doc);
|
39
|
-
}
|
40
|
-
|
41
|
-
int main(void) {
|
42
|
-
/*
|
43
|
-
* this initialize the library and check potential ABI mismatches
|
44
|
-
* between the version it was compiled for and the actual shared
|
45
|
-
* library used.
|
46
|
-
*/
|
47
|
-
LIBXML_TEST_VERSION
|
48
|
-
|
49
|
-
example3Func(document, 6);
|
50
|
-
|
51
|
-
/*
|
52
|
-
* Cleanup function for the XML library.
|
53
|
-
*/
|
54
|
-
xmlCleanupParser();
|
55
|
-
/*
|
56
|
-
* this is to debug memory for regression tests
|
57
|
-
*/
|
58
|
-
xmlMemoryDump();
|
59
|
-
return(0);
|
60
|
-
}
|
@@ -1,143 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* section: Parsing
|
3
|
-
* synopsis: Parse an XML document chunk by chunk to a tree and free it
|
4
|
-
* purpose: Demonstrate the use of xmlCreatePushParserCtxt() and
|
5
|
-
* xmlParseChunk() to read an XML file progressively
|
6
|
-
* into a tree and and xmlFreeDoc() to free the resulting tree
|
7
|
-
* usage: parse4 test3.xml
|
8
|
-
* test: parse4 test3.xml
|
9
|
-
* author: Daniel Veillard
|
10
|
-
* copy: see Copyright for the status of this software.
|
11
|
-
*/
|
12
|
-
|
13
|
-
#include <stdio.h>
|
14
|
-
#include <libxml/parser.h>
|
15
|
-
#include <libxml/tree.h>
|
16
|
-
|
17
|
-
#ifdef LIBXML_PUSH_ENABLED
|
18
|
-
static FILE *desc;
|
19
|
-
|
20
|
-
/**
|
21
|
-
* readPacket:
|
22
|
-
* @mem: array to store the packet
|
23
|
-
* @size: the packet size
|
24
|
-
*
|
25
|
-
* read at most @size bytes from the document and store it in @mem
|
26
|
-
*
|
27
|
-
* Returns the number of bytes read
|
28
|
-
*/
|
29
|
-
static int
|
30
|
-
readPacket(char *mem, int size) {
|
31
|
-
int res;
|
32
|
-
|
33
|
-
res = fread(mem, 1, size, desc);
|
34
|
-
return(res);
|
35
|
-
}
|
36
|
-
|
37
|
-
/**
|
38
|
-
* example4Func:
|
39
|
-
* @filename: a filename or an URL
|
40
|
-
*
|
41
|
-
* Parse the resource and free the resulting tree
|
42
|
-
*/
|
43
|
-
static void
|
44
|
-
example4Func(const char *filename) {
|
45
|
-
xmlParserCtxtPtr ctxt;
|
46
|
-
char chars[4];
|
47
|
-
xmlDocPtr doc; /* the resulting document tree */
|
48
|
-
int res;
|
49
|
-
|
50
|
-
/*
|
51
|
-
* Read a few first byte to check the input used for the
|
52
|
-
* encoding detection at the parser level.
|
53
|
-
*/
|
54
|
-
res = readPacket(chars, 4);
|
55
|
-
if (res <= 0) {
|
56
|
-
fprintf(stderr, "Failed to parse %s\n", filename);
|
57
|
-
return;
|
58
|
-
}
|
59
|
-
|
60
|
-
/*
|
61
|
-
* Create a progressive parsing context, the 2 first arguments
|
62
|
-
* are not used since we want to build a tree and not use a SAX
|
63
|
-
* parsing interface. We also pass the first bytes of the document
|
64
|
-
* to allow encoding detection when creating the parser but this
|
65
|
-
* is optional.
|
66
|
-
*/
|
67
|
-
ctxt = xmlCreatePushParserCtxt(NULL, NULL,
|
68
|
-
chars, res, filename);
|
69
|
-
if (ctxt == NULL) {
|
70
|
-
fprintf(stderr, "Failed to create parser context !\n");
|
71
|
-
return;
|
72
|
-
}
|
73
|
-
|
74
|
-
/*
|
75
|
-
* loop on the input getting the document data, of course 4 bytes
|
76
|
-
* at a time is not realistic but allows to verify testing on small
|
77
|
-
* documents.
|
78
|
-
*/
|
79
|
-
while ((res = readPacket(chars, 4)) > 0) {
|
80
|
-
xmlParseChunk(ctxt, chars, res, 0);
|
81
|
-
}
|
82
|
-
|
83
|
-
/*
|
84
|
-
* there is no more input, indicate the parsing is finished.
|
85
|
-
*/
|
86
|
-
xmlParseChunk(ctxt, chars, 0, 1);
|
87
|
-
|
88
|
-
/*
|
89
|
-
* collect the document back and if it was wellformed
|
90
|
-
* and destroy the parser context.
|
91
|
-
*/
|
92
|
-
doc = ctxt->myDoc;
|
93
|
-
res = ctxt->wellFormed;
|
94
|
-
xmlFreeParserCtxt(ctxt);
|
95
|
-
|
96
|
-
if (!res) {
|
97
|
-
fprintf(stderr, "Failed to parse %s\n", filename);
|
98
|
-
}
|
99
|
-
|
100
|
-
/*
|
101
|
-
* since we don't use the document, destroy it now.
|
102
|
-
*/
|
103
|
-
xmlFreeDoc(doc);
|
104
|
-
}
|
105
|
-
|
106
|
-
int main(int argc, char **argv) {
|
107
|
-
if (argc != 2)
|
108
|
-
return(1);
|
109
|
-
|
110
|
-
/*
|
111
|
-
* this initialize the library and check potential ABI mismatches
|
112
|
-
* between the version it was compiled for and the actual shared
|
113
|
-
* library used.
|
114
|
-
*/
|
115
|
-
LIBXML_TEST_VERSION
|
116
|
-
|
117
|
-
/*
|
118
|
-
* simulate a progressive parsing using the input file.
|
119
|
-
*/
|
120
|
-
desc = fopen(argv[1], "rb");
|
121
|
-
if (desc != NULL) {
|
122
|
-
example4Func(argv[1]);
|
123
|
-
fclose(desc);
|
124
|
-
} else {
|
125
|
-
fprintf(stderr, "Failed to parse %s\n", argv[1]);
|
126
|
-
}
|
127
|
-
|
128
|
-
/*
|
129
|
-
* Cleanup function for the XML library.
|
130
|
-
*/
|
131
|
-
xmlCleanupParser();
|
132
|
-
/*
|
133
|
-
* this is to debug memory for regression tests
|
134
|
-
*/
|
135
|
-
xmlMemoryDump();
|
136
|
-
return(0);
|
137
|
-
}
|
138
|
-
#else /* ! LIBXML_PUSH_ENABLED */
|
139
|
-
int main(int argc, char **argv) {
|
140
|
-
fprintf(stderr, "Library not compiled with push parser support\n");
|
141
|
-
return(1);
|
142
|
-
}
|
143
|
-
#endif
|