pocjenkixx 0.30.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of pocjenkixx might be problematic. Click here for more details.
- package/LICENSE +19 -0
- package/Makefile +18 -0
- package/README.md +52 -0
- package/binding.gyp +81 -0
- package/index.d.ts +273 -0
- package/index.js +45 -0
- package/lib/bindings.js +1 -0
- package/lib/document.js +122 -0
- package/lib/element.js +82 -0
- package/lib/sax_parser.js +38 -0
- package/package.json +70 -0
- package/src/html_document.cc +7 -0
- package/src/html_document.h +18 -0
- package/src/libxmljs.cc +252 -0
- package/src/libxmljs.h +53 -0
- package/src/xml_attribute.cc +173 -0
- package/src/xml_attribute.h +40 -0
- package/src/xml_comment.cc +117 -0
- package/src/xml_comment.h +30 -0
- package/src/xml_document.cc +810 -0
- package/src/xml_document.h +67 -0
- package/src/xml_element.cc +565 -0
- package/src/xml_element.h +61 -0
- package/src/xml_namespace.cc +158 -0
- package/src/xml_namespace.h +39 -0
- package/src/xml_node.cc +761 -0
- package/src/xml_node.h +73 -0
- package/src/xml_pi.cc +161 -0
- package/src/xml_pi.h +34 -0
- package/src/xml_sax_parser.cc +424 -0
- package/src/xml_sax_parser.h +73 -0
- package/src/xml_syntax_error.cc +66 -0
- package/src/xml_syntax_error.h +25 -0
- package/src/xml_text.cc +320 -0
- package/src/xml_text.h +48 -0
- package/src/xml_textwriter.cc +315 -0
- package/src/xml_textwriter.h +62 -0
- package/src/xml_xpath_context.cc +70 -0
- package/src/xml_xpath_context.h +23 -0
- package/vendor/libxml/Copyright +23 -0
- package/vendor/libxml/DOCBparser.c +305 -0
- package/vendor/libxml/HTMLparser.c +7287 -0
- package/vendor/libxml/HTMLtree.c +1200 -0
- package/vendor/libxml/Makefile +2983 -0
- package/vendor/libxml/SAX.c +180 -0
- package/vendor/libxml/SAX2.c +3036 -0
- package/vendor/libxml/buf.c +1351 -0
- package/vendor/libxml/buf.h +72 -0
- package/vendor/libxml/c14n.c +2234 -0
- package/vendor/libxml/catalog.c +3828 -0
- package/vendor/libxml/chvalid.c +336 -0
- package/vendor/libxml/config.h +294 -0
- package/vendor/libxml/config.h.gch +0 -0
- package/vendor/libxml/debugXML.c +3423 -0
- package/vendor/libxml/dict.c +1298 -0
- package/vendor/libxml/elfgcchack.h +17818 -0
- package/vendor/libxml/enc.h +32 -0
- package/vendor/libxml/encoding.c +3975 -0
- package/vendor/libxml/entities.c +1163 -0
- package/vendor/libxml/error.c +998 -0
- package/vendor/libxml/globals.c +1126 -0
- package/vendor/libxml/hash.c +1146 -0
- package/vendor/libxml/include/libxml/DOCBparser.h +96 -0
- package/vendor/libxml/include/libxml/HTMLparser.h +306 -0
- package/vendor/libxml/include/libxml/HTMLtree.h +147 -0
- package/vendor/libxml/include/libxml/Makefile +725 -0
- package/vendor/libxml/include/libxml/Makefile.am +54 -0
- package/vendor/libxml/include/libxml/Makefile.in +725 -0
- package/vendor/libxml/include/libxml/SAX.h +173 -0
- package/vendor/libxml/include/libxml/SAX2.h +178 -0
- package/vendor/libxml/include/libxml/c14n.h +128 -0
- package/vendor/libxml/include/libxml/catalog.h +182 -0
- package/vendor/libxml/include/libxml/chvalid.h +230 -0
- package/vendor/libxml/include/libxml/debugXML.h +217 -0
- package/vendor/libxml/include/libxml/dict.h +79 -0
- package/vendor/libxml/include/libxml/encoding.h +245 -0
- package/vendor/libxml/include/libxml/entities.h +151 -0
- package/vendor/libxml/include/libxml/globals.h +508 -0
- package/vendor/libxml/include/libxml/hash.h +236 -0
- package/vendor/libxml/include/libxml/list.h +137 -0
- package/vendor/libxml/include/libxml/nanoftp.h +163 -0
- package/vendor/libxml/include/libxml/nanohttp.h +81 -0
- package/vendor/libxml/include/libxml/parser.h +1243 -0
- package/vendor/libxml/include/libxml/parserInternals.h +644 -0
- package/vendor/libxml/include/libxml/pattern.h +100 -0
- package/vendor/libxml/include/libxml/relaxng.h +217 -0
- package/vendor/libxml/include/libxml/schemasInternals.h +958 -0
- package/vendor/libxml/include/libxml/schematron.h +142 -0
- package/vendor/libxml/include/libxml/threads.h +89 -0
- package/vendor/libxml/include/libxml/tree.h +1311 -0
- package/vendor/libxml/include/libxml/uri.h +94 -0
- package/vendor/libxml/include/libxml/valid.h +458 -0
- package/vendor/libxml/include/libxml/xinclude.h +129 -0
- package/vendor/libxml/include/libxml/xlink.h +189 -0
- package/vendor/libxml/include/libxml/xmlIO.h +368 -0
- package/vendor/libxml/include/libxml/xmlautomata.h +146 -0
- package/vendor/libxml/include/libxml/xmlerror.h +945 -0
- package/vendor/libxml/include/libxml/xmlexports.h +77 -0
- package/vendor/libxml/include/libxml/xmlmemory.h +224 -0
- package/vendor/libxml/include/libxml/xmlmodule.h +57 -0
- package/vendor/libxml/include/libxml/xmlreader.h +428 -0
- package/vendor/libxml/include/libxml/xmlregexp.h +222 -0
- package/vendor/libxml/include/libxml/xmlsave.h +88 -0
- package/vendor/libxml/include/libxml/xmlschemas.h +246 -0
- package/vendor/libxml/include/libxml/xmlschemastypes.h +151 -0
- package/vendor/libxml/include/libxml/xmlstring.h +140 -0
- package/vendor/libxml/include/libxml/xmlunicode.h +202 -0
- package/vendor/libxml/include/libxml/xmlversion.h +484 -0
- package/vendor/libxml/include/libxml/xmlwin32version.h +239 -0
- package/vendor/libxml/include/libxml/xmlwriter.h +488 -0
- package/vendor/libxml/include/libxml/xpath.h +564 -0
- package/vendor/libxml/include/libxml/xpathInternals.h +632 -0
- package/vendor/libxml/include/libxml/xpointer.h +114 -0
- package/vendor/libxml/include/win32config.h +122 -0
- package/vendor/libxml/include/wsockcompat.h +54 -0
- package/vendor/libxml/legacy.c +1343 -0
- package/vendor/libxml/libxml.h +134 -0
- package/vendor/libxml/list.c +779 -0
- package/vendor/libxml/nanoftp.c +2118 -0
- package/vendor/libxml/nanohttp.c +1899 -0
- package/vendor/libxml/parser.c +15553 -0
- package/vendor/libxml/parserInternals.c +2164 -0
- package/vendor/libxml/pattern.c +2621 -0
- package/vendor/libxml/relaxng.c +11101 -0
- package/vendor/libxml/rngparser.c +1595 -0
- package/vendor/libxml/runsuite.c +1157 -0
- package/vendor/libxml/save.h +36 -0
- package/vendor/libxml/schematron.c +1787 -0
- package/vendor/libxml/threads.c +1049 -0
- package/vendor/libxml/timsort.h +601 -0
- package/vendor/libxml/tree.c +10183 -0
- package/vendor/libxml/trio.c +6895 -0
- package/vendor/libxml/trio.h +230 -0
- package/vendor/libxml/triodef.h +228 -0
- package/vendor/libxml/trionan.c +914 -0
- package/vendor/libxml/trionan.h +84 -0
- package/vendor/libxml/triop.h +150 -0
- package/vendor/libxml/triostr.c +2112 -0
- package/vendor/libxml/triostr.h +144 -0
- package/vendor/libxml/uri.c +2561 -0
- package/vendor/libxml/valid.c +7138 -0
- package/vendor/libxml/xinclude.c +2657 -0
- package/vendor/libxml/xlink.c +183 -0
- package/vendor/libxml/xmlIO.c +4135 -0
- package/vendor/libxml/xmlcatalog.c +624 -0
- package/vendor/libxml/xmllint.c +3796 -0
- package/vendor/libxml/xmlmemory.c +1163 -0
- package/vendor/libxml/xmlmodule.c +468 -0
- package/vendor/libxml/xmlreader.c +6033 -0
- package/vendor/libxml/xmlregexp.c +8271 -0
- package/vendor/libxml/xmlsave.c +2735 -0
- package/vendor/libxml/xmlschemas.c +29173 -0
- package/vendor/libxml/xmlschemastypes.c +6276 -0
- package/vendor/libxml/xmlstring.c +1050 -0
- package/vendor/libxml/xmlunicode.c +3179 -0
- package/vendor/libxml/xmlwriter.c +4738 -0
- package/vendor/libxml/xpath.c +14734 -0
- package/vendor/libxml/xpointer.c +2969 -0
- package/vendor/libxml/xzlib.c +815 -0
- package/vendor/libxml/xzlib.h +19 -0
@@ -0,0 +1,305 @@
|
|
1
|
+
/*
|
2
|
+
* DOCBparser.c : an attempt to parse SGML Docbook documents
|
3
|
+
*
|
4
|
+
* This is deprecated !!!
|
5
|
+
* Code removed with release 2.6.0 it was broken.
|
6
|
+
* The doc are expect to be migrated to XML DocBook
|
7
|
+
*
|
8
|
+
* See Copyright for the status of this software.
|
9
|
+
*
|
10
|
+
* daniel@veillard.com
|
11
|
+
*/
|
12
|
+
|
13
|
+
#define IN_LIBXML
|
14
|
+
#include "libxml.h"
|
15
|
+
#ifdef LIBXML_DOCB_ENABLED
|
16
|
+
|
17
|
+
#include <libxml/xmlerror.h>
|
18
|
+
#include <libxml/DOCBparser.h>
|
19
|
+
|
20
|
+
/**
|
21
|
+
* docbEncodeEntities:
|
22
|
+
* @out: a pointer to an array of bytes to store the result
|
23
|
+
* @outlen: the length of @out
|
24
|
+
* @in: a pointer to an array of UTF-8 chars
|
25
|
+
* @inlen: the length of @in
|
26
|
+
* @quoteChar: the quote character to escape (' or ") or zero.
|
27
|
+
*
|
28
|
+
* Take a block of UTF-8 chars in and try to convert it to an ASCII
|
29
|
+
* plus SGML entities block of chars out.
|
30
|
+
*
|
31
|
+
* Returns 0 if success, -2 if the transcoding fails, or -1 otherwise
|
32
|
+
* The value of @inlen after return is the number of octets consumed
|
33
|
+
* as the return value is positive, else unpredictable.
|
34
|
+
* The value of @outlen after return is the number of octets consumed.
|
35
|
+
*/
|
36
|
+
int
|
37
|
+
docbEncodeEntities(unsigned char *out ATTRIBUTE_UNUSED,
|
38
|
+
int *outlen ATTRIBUTE_UNUSED,
|
39
|
+
const unsigned char *in ATTRIBUTE_UNUSED,
|
40
|
+
int *inlen ATTRIBUTE_UNUSED,
|
41
|
+
int quoteChar ATTRIBUTE_UNUSED)
|
42
|
+
{
|
43
|
+
static int deprecated = 0;
|
44
|
+
|
45
|
+
if (!deprecated) {
|
46
|
+
xmlGenericError(xmlGenericErrorContext,
|
47
|
+
"docbEncodeEntities() deprecated function reached\n");
|
48
|
+
deprecated = 1;
|
49
|
+
}
|
50
|
+
return(-1);
|
51
|
+
}
|
52
|
+
|
53
|
+
/**
|
54
|
+
* docbParseDocument:
|
55
|
+
* @ctxt: an SGML parser context
|
56
|
+
*
|
57
|
+
* parse an SGML document (and build a tree if using the standard SAX
|
58
|
+
* interface).
|
59
|
+
*
|
60
|
+
* Returns 0, -1 in case of error. the parser context is augmented
|
61
|
+
* as a result of the parsing.
|
62
|
+
*/
|
63
|
+
|
64
|
+
int
|
65
|
+
docbParseDocument(docbParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
|
66
|
+
{
|
67
|
+
static int deprecated = 0;
|
68
|
+
|
69
|
+
if (!deprecated) {
|
70
|
+
xmlGenericError(xmlGenericErrorContext,
|
71
|
+
"docbParseDocument() deprecated function reached\n");
|
72
|
+
deprecated = 1;
|
73
|
+
}
|
74
|
+
return (xmlParseDocument(ctxt));
|
75
|
+
}
|
76
|
+
|
77
|
+
/**
|
78
|
+
* docbFreeParserCtxt:
|
79
|
+
* @ctxt: an SGML parser context
|
80
|
+
*
|
81
|
+
* Free all the memory used by a parser context. However the parsed
|
82
|
+
* document in ctxt->myDoc is not freed.
|
83
|
+
*/
|
84
|
+
|
85
|
+
void
|
86
|
+
docbFreeParserCtxt(docbParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
|
87
|
+
{
|
88
|
+
static int deprecated = 0;
|
89
|
+
|
90
|
+
if (!deprecated) {
|
91
|
+
xmlGenericError(xmlGenericErrorContext,
|
92
|
+
"docbFreeParserCtxt() deprecated function reached\n");
|
93
|
+
deprecated = 1;
|
94
|
+
}
|
95
|
+
xmlFreeParserCtxt(ctxt);
|
96
|
+
}
|
97
|
+
|
98
|
+
/**
|
99
|
+
* docbParseChunk:
|
100
|
+
* @ctxt: an XML parser context
|
101
|
+
* @chunk: an char array
|
102
|
+
* @size: the size in byte of the chunk
|
103
|
+
* @terminate: last chunk indicator
|
104
|
+
*
|
105
|
+
* Parse a Chunk of memory
|
106
|
+
*
|
107
|
+
* Returns zero if no error, the xmlParserErrors otherwise.
|
108
|
+
*/
|
109
|
+
int
|
110
|
+
docbParseChunk(docbParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
|
111
|
+
const char *chunk ATTRIBUTE_UNUSED,
|
112
|
+
int size ATTRIBUTE_UNUSED,
|
113
|
+
int terminate ATTRIBUTE_UNUSED)
|
114
|
+
{
|
115
|
+
static int deprecated = 0;
|
116
|
+
|
117
|
+
if (!deprecated) {
|
118
|
+
xmlGenericError(xmlGenericErrorContext,
|
119
|
+
"docbParseChunk() deprecated function reached\n");
|
120
|
+
deprecated = 1;
|
121
|
+
}
|
122
|
+
|
123
|
+
return (xmlParseChunk(ctxt, chunk, size, terminate));
|
124
|
+
}
|
125
|
+
|
126
|
+
/**
|
127
|
+
* docbCreatePushParserCtxt:
|
128
|
+
* @sax: a SAX handler
|
129
|
+
* @user_data: The user data returned on SAX callbacks
|
130
|
+
* @chunk: a pointer to an array of chars
|
131
|
+
* @size: number of chars in the array
|
132
|
+
* @filename: an optional file name or URI
|
133
|
+
* @enc: an optional encoding
|
134
|
+
*
|
135
|
+
* Create a parser context for using the DocBook SGML parser in push mode
|
136
|
+
* To allow content encoding detection, @size should be >= 4
|
137
|
+
* The value of @filename is used for fetching external entities
|
138
|
+
* and error/warning reports.
|
139
|
+
*
|
140
|
+
* Returns the new parser context or NULL
|
141
|
+
*/
|
142
|
+
docbParserCtxtPtr
|
143
|
+
docbCreatePushParserCtxt(docbSAXHandlerPtr sax ATTRIBUTE_UNUSED,
|
144
|
+
void *user_data ATTRIBUTE_UNUSED,
|
145
|
+
const char *chunk ATTRIBUTE_UNUSED,
|
146
|
+
int size ATTRIBUTE_UNUSED,
|
147
|
+
const char *filename ATTRIBUTE_UNUSED,
|
148
|
+
xmlCharEncoding enc ATTRIBUTE_UNUSED)
|
149
|
+
{
|
150
|
+
static int deprecated = 0;
|
151
|
+
|
152
|
+
if (!deprecated) {
|
153
|
+
xmlGenericError(xmlGenericErrorContext,
|
154
|
+
"docbParseChunk() deprecated function reached\n");
|
155
|
+
deprecated = 1;
|
156
|
+
}
|
157
|
+
|
158
|
+
return(xmlCreatePushParserCtxt(sax, user_data, chunk, size, filename));
|
159
|
+
}
|
160
|
+
|
161
|
+
/**
|
162
|
+
* docbSAXParseDoc:
|
163
|
+
* @cur: a pointer to an array of xmlChar
|
164
|
+
* @encoding: a free form C string describing the SGML document encoding, or NULL
|
165
|
+
* @sax: the SAX handler block
|
166
|
+
* @userData: if using SAX, this pointer will be provided on callbacks.
|
167
|
+
*
|
168
|
+
* parse an SGML in-memory document and build a tree.
|
169
|
+
* It use the given SAX function block to handle the parsing callback.
|
170
|
+
* If sax is NULL, fallback to the default DOM tree building routines.
|
171
|
+
*
|
172
|
+
* Returns the resulting document tree
|
173
|
+
*/
|
174
|
+
|
175
|
+
docbDocPtr
|
176
|
+
docbSAXParseDoc(xmlChar * cur ATTRIBUTE_UNUSED,
|
177
|
+
const char *encoding ATTRIBUTE_UNUSED,
|
178
|
+
docbSAXHandlerPtr sax ATTRIBUTE_UNUSED,
|
179
|
+
void *userData ATTRIBUTE_UNUSED)
|
180
|
+
{
|
181
|
+
static int deprecated = 0;
|
182
|
+
|
183
|
+
if (!deprecated) {
|
184
|
+
xmlGenericError(xmlGenericErrorContext,
|
185
|
+
"docbParseChunk() deprecated function reached\n");
|
186
|
+
deprecated = 1;
|
187
|
+
}
|
188
|
+
|
189
|
+
return (xmlSAXParseMemoryWithData(sax, (const char *)cur,
|
190
|
+
xmlStrlen((const xmlChar *) cur), 0, userData));
|
191
|
+
}
|
192
|
+
|
193
|
+
/**
|
194
|
+
* docbParseDoc:
|
195
|
+
* @cur: a pointer to an array of xmlChar
|
196
|
+
* @encoding: a free form C string describing the SGML document encoding, or NULL
|
197
|
+
*
|
198
|
+
* parse an SGML in-memory document and build a tree.
|
199
|
+
*
|
200
|
+
* Returns the resulting document tree
|
201
|
+
*/
|
202
|
+
|
203
|
+
docbDocPtr
|
204
|
+
docbParseDoc(xmlChar * cur ATTRIBUTE_UNUSED,
|
205
|
+
const char *encoding ATTRIBUTE_UNUSED)
|
206
|
+
{
|
207
|
+
static int deprecated = 0;
|
208
|
+
|
209
|
+
if (!deprecated) {
|
210
|
+
xmlGenericError(xmlGenericErrorContext,
|
211
|
+
"docbParseChunk() deprecated function reached\n");
|
212
|
+
deprecated = 1;
|
213
|
+
}
|
214
|
+
|
215
|
+
return (xmlParseDoc(cur));
|
216
|
+
}
|
217
|
+
|
218
|
+
|
219
|
+
/**
|
220
|
+
* docbCreateFileParserCtxt:
|
221
|
+
* @filename: the filename
|
222
|
+
* @encoding: the SGML document encoding, or NULL
|
223
|
+
*
|
224
|
+
* Create a parser context for a file content.
|
225
|
+
* Automatic support for ZLIB/Compress compressed document is provided
|
226
|
+
* by default if found at compile-time.
|
227
|
+
*
|
228
|
+
* Returns the new parser context or NULL
|
229
|
+
*/
|
230
|
+
docbParserCtxtPtr
|
231
|
+
docbCreateFileParserCtxt(const char *filename ATTRIBUTE_UNUSED,
|
232
|
+
const char *encoding ATTRIBUTE_UNUSED)
|
233
|
+
{
|
234
|
+
static int deprecated = 0;
|
235
|
+
|
236
|
+
if (!deprecated) {
|
237
|
+
xmlGenericError(xmlGenericErrorContext,
|
238
|
+
"docbCreateFileParserCtxt() deprecated function reached\n");
|
239
|
+
deprecated = 1;
|
240
|
+
}
|
241
|
+
|
242
|
+
return (xmlCreateFileParserCtxt(filename));
|
243
|
+
}
|
244
|
+
|
245
|
+
/**
|
246
|
+
* docbSAXParseFile:
|
247
|
+
* @filename: the filename
|
248
|
+
* @encoding: a free form C string describing the SGML document encoding, or NULL
|
249
|
+
* @sax: the SAX handler block
|
250
|
+
* @userData: if using SAX, this pointer will be provided on callbacks.
|
251
|
+
*
|
252
|
+
* parse an SGML file and build a tree. Automatic support for ZLIB/Compress
|
253
|
+
* compressed document is provided by default if found at compile-time.
|
254
|
+
* It use the given SAX function block to handle the parsing callback.
|
255
|
+
* If sax is NULL, fallback to the default DOM tree building routines.
|
256
|
+
*
|
257
|
+
* Returns the resulting document tree
|
258
|
+
*/
|
259
|
+
|
260
|
+
docbDocPtr
|
261
|
+
docbSAXParseFile(const char *filename ATTRIBUTE_UNUSED,
|
262
|
+
const char *encoding ATTRIBUTE_UNUSED,
|
263
|
+
docbSAXHandlerPtr sax ATTRIBUTE_UNUSED,
|
264
|
+
void *userData ATTRIBUTE_UNUSED)
|
265
|
+
{
|
266
|
+
static int deprecated = 0;
|
267
|
+
|
268
|
+
if (!deprecated) {
|
269
|
+
xmlGenericError(xmlGenericErrorContext,
|
270
|
+
"docbSAXParseFile() deprecated function reached\n");
|
271
|
+
deprecated = 1;
|
272
|
+
}
|
273
|
+
|
274
|
+
return (xmlSAXParseFileWithData(sax, filename, 0, userData));
|
275
|
+
}
|
276
|
+
|
277
|
+
/**
|
278
|
+
* docbParseFile:
|
279
|
+
* @filename: the filename
|
280
|
+
* @encoding: a free form C string describing document encoding, or NULL
|
281
|
+
*
|
282
|
+
* parse a Docbook SGML file and build a tree. Automatic support for
|
283
|
+
* ZLIB/Compress compressed document is provided by default if found
|
284
|
+
* at compile-time.
|
285
|
+
*
|
286
|
+
* Returns the resulting document tree
|
287
|
+
*/
|
288
|
+
|
289
|
+
docbDocPtr
|
290
|
+
docbParseFile(const char *filename ATTRIBUTE_UNUSED,
|
291
|
+
const char *encoding ATTRIBUTE_UNUSED)
|
292
|
+
{
|
293
|
+
static int deprecated = 0;
|
294
|
+
|
295
|
+
if (!deprecated) {
|
296
|
+
xmlGenericError(xmlGenericErrorContext,
|
297
|
+
"docbParseFile() deprecated function reached\n");
|
298
|
+
deprecated = 1;
|
299
|
+
}
|
300
|
+
|
301
|
+
return (xmlParseFile(filename));
|
302
|
+
}
|
303
|
+
#define bottom_DOCBparser
|
304
|
+
#include "elfgcchack.h"
|
305
|
+
#endif /* LIBXML_DOCB_ENABLED */
|