nokogiri 1.11.0.rc4-arm64-darwin
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of nokogiri might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/LICENSE-DEPENDENCIES.md +1682 -0
- data/LICENSE.md +9 -0
- data/README.md +200 -0
- data/bin/nokogiri +118 -0
- data/dependencies.yml +74 -0
- data/ext/nokogiri/depend +477 -0
- data/ext/nokogiri/extconf.rb +819 -0
- data/ext/nokogiri/html_document.c +171 -0
- data/ext/nokogiri/html_document.h +10 -0
- data/ext/nokogiri/html_element_description.c +279 -0
- data/ext/nokogiri/html_element_description.h +10 -0
- data/ext/nokogiri/html_entity_lookup.c +32 -0
- data/ext/nokogiri/html_entity_lookup.h +8 -0
- data/ext/nokogiri/html_sax_parser_context.c +116 -0
- data/ext/nokogiri/html_sax_parser_context.h +11 -0
- data/ext/nokogiri/html_sax_push_parser.c +87 -0
- data/ext/nokogiri/html_sax_push_parser.h +9 -0
- data/ext/nokogiri/include/libexslt/exslt.h +102 -0
- data/ext/nokogiri/include/libexslt/exsltconfig.h +70 -0
- data/ext/nokogiri/include/libexslt/exsltexports.h +140 -0
- data/ext/nokogiri/include/libxml2/libxml/DOCBparser.h +96 -0
- data/ext/nokogiri/include/libxml2/libxml/HTMLparser.h +306 -0
- data/ext/nokogiri/include/libxml2/libxml/HTMLtree.h +147 -0
- data/ext/nokogiri/include/libxml2/libxml/SAX.h +173 -0
- data/ext/nokogiri/include/libxml2/libxml/SAX2.h +178 -0
- data/ext/nokogiri/include/libxml2/libxml/c14n.h +126 -0
- data/ext/nokogiri/include/libxml2/libxml/catalog.h +182 -0
- data/ext/nokogiri/include/libxml2/libxml/chvalid.h +230 -0
- data/ext/nokogiri/include/libxml2/libxml/debugXML.h +217 -0
- data/ext/nokogiri/include/libxml2/libxml/dict.h +79 -0
- data/ext/nokogiri/include/libxml2/libxml/encoding.h +245 -0
- data/ext/nokogiri/include/libxml2/libxml/entities.h +151 -0
- data/ext/nokogiri/include/libxml2/libxml/globals.h +508 -0
- data/ext/nokogiri/include/libxml2/libxml/hash.h +236 -0
- data/ext/nokogiri/include/libxml2/libxml/list.h +137 -0
- data/ext/nokogiri/include/libxml2/libxml/nanoftp.h +163 -0
- data/ext/nokogiri/include/libxml2/libxml/nanohttp.h +81 -0
- data/ext/nokogiri/include/libxml2/libxml/parser.h +1241 -0
- data/ext/nokogiri/include/libxml2/libxml/parserInternals.h +644 -0
- data/ext/nokogiri/include/libxml2/libxml/pattern.h +100 -0
- data/ext/nokogiri/include/libxml2/libxml/relaxng.h +217 -0
- data/ext/nokogiri/include/libxml2/libxml/schemasInternals.h +958 -0
- data/ext/nokogiri/include/libxml2/libxml/schematron.h +142 -0
- data/ext/nokogiri/include/libxml2/libxml/threads.h +89 -0
- data/ext/nokogiri/include/libxml2/libxml/tree.h +1311 -0
- data/ext/nokogiri/include/libxml2/libxml/uri.h +94 -0
- data/ext/nokogiri/include/libxml2/libxml/valid.h +458 -0
- data/ext/nokogiri/include/libxml2/libxml/xinclude.h +129 -0
- data/ext/nokogiri/include/libxml2/libxml/xlink.h +189 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlIO.h +366 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlautomata.h +146 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlerror.h +945 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlexports.h +153 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlmemory.h +224 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlmodule.h +57 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlreader.h +428 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlregexp.h +222 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlsave.h +88 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlschemas.h +246 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlschemastypes.h +151 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlstring.h +140 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlunicode.h +202 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlversion.h +485 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlwriter.h +488 -0
- data/ext/nokogiri/include/libxml2/libxml/xpath.h +566 -0
- data/ext/nokogiri/include/libxml2/libxml/xpathInternals.h +632 -0
- data/ext/nokogiri/include/libxml2/libxml/xpointer.h +114 -0
- data/ext/nokogiri/include/libxslt/attributes.h +38 -0
- data/ext/nokogiri/include/libxslt/documents.h +93 -0
- data/ext/nokogiri/include/libxslt/extensions.h +262 -0
- data/ext/nokogiri/include/libxslt/extra.h +72 -0
- data/ext/nokogiri/include/libxslt/functions.h +78 -0
- data/ext/nokogiri/include/libxslt/imports.h +75 -0
- data/ext/nokogiri/include/libxslt/keys.h +53 -0
- data/ext/nokogiri/include/libxslt/namespaces.h +68 -0
- data/ext/nokogiri/include/libxslt/numbersInternals.h +73 -0
- data/ext/nokogiri/include/libxslt/pattern.h +84 -0
- data/ext/nokogiri/include/libxslt/preproc.h +43 -0
- data/ext/nokogiri/include/libxslt/security.h +104 -0
- data/ext/nokogiri/include/libxslt/templates.h +77 -0
- data/ext/nokogiri/include/libxslt/transform.h +207 -0
- data/ext/nokogiri/include/libxslt/variables.h +118 -0
- data/ext/nokogiri/include/libxslt/xslt.h +110 -0
- data/ext/nokogiri/include/libxslt/xsltInternals.h +1978 -0
- data/ext/nokogiri/include/libxslt/xsltconfig.h +180 -0
- data/ext/nokogiri/include/libxslt/xsltexports.h +142 -0
- data/ext/nokogiri/include/libxslt/xsltlocale.h +76 -0
- data/ext/nokogiri/include/libxslt/xsltutils.h +313 -0
- data/ext/nokogiri/nokogiri.c +135 -0
- data/ext/nokogiri/nokogiri.h +130 -0
- data/ext/nokogiri/xml_attr.c +103 -0
- data/ext/nokogiri/xml_attr.h +9 -0
- data/ext/nokogiri/xml_attribute_decl.c +70 -0
- data/ext/nokogiri/xml_attribute_decl.h +9 -0
- data/ext/nokogiri/xml_cdata.c +62 -0
- data/ext/nokogiri/xml_cdata.h +9 -0
- data/ext/nokogiri/xml_comment.c +69 -0
- data/ext/nokogiri/xml_comment.h +9 -0
- data/ext/nokogiri/xml_document.c +622 -0
- data/ext/nokogiri/xml_document.h +23 -0
- data/ext/nokogiri/xml_document_fragment.c +48 -0
- data/ext/nokogiri/xml_document_fragment.h +10 -0
- data/ext/nokogiri/xml_dtd.c +202 -0
- data/ext/nokogiri/xml_dtd.h +10 -0
- data/ext/nokogiri/xml_element_content.c +123 -0
- data/ext/nokogiri/xml_element_content.h +10 -0
- data/ext/nokogiri/xml_element_decl.c +69 -0
- data/ext/nokogiri/xml_element_decl.h +9 -0
- data/ext/nokogiri/xml_encoding_handler.c +79 -0
- data/ext/nokogiri/xml_encoding_handler.h +8 -0
- data/ext/nokogiri/xml_entity_decl.c +110 -0
- data/ext/nokogiri/xml_entity_decl.h +10 -0
- data/ext/nokogiri/xml_entity_reference.c +52 -0
- data/ext/nokogiri/xml_entity_reference.h +9 -0
- data/ext/nokogiri/xml_io.c +63 -0
- data/ext/nokogiri/xml_io.h +11 -0
- data/ext/nokogiri/xml_libxml2_hacks.c +112 -0
- data/ext/nokogiri/xml_libxml2_hacks.h +12 -0
- data/ext/nokogiri/xml_namespace.c +111 -0
- data/ext/nokogiri/xml_namespace.h +14 -0
- data/ext/nokogiri/xml_node.c +1773 -0
- data/ext/nokogiri/xml_node.h +13 -0
- data/ext/nokogiri/xml_node_set.c +486 -0
- data/ext/nokogiri/xml_node_set.h +12 -0
- data/ext/nokogiri/xml_processing_instruction.c +56 -0
- data/ext/nokogiri/xml_processing_instruction.h +9 -0
- data/ext/nokogiri/xml_reader.c +657 -0
- data/ext/nokogiri/xml_reader.h +10 -0
- data/ext/nokogiri/xml_relax_ng.c +179 -0
- data/ext/nokogiri/xml_relax_ng.h +9 -0
- data/ext/nokogiri/xml_sax_parser.c +305 -0
- data/ext/nokogiri/xml_sax_parser.h +39 -0
- data/ext/nokogiri/xml_sax_parser_context.c +262 -0
- data/ext/nokogiri/xml_sax_parser_context.h +10 -0
- data/ext/nokogiri/xml_sax_push_parser.c +159 -0
- data/ext/nokogiri/xml_sax_push_parser.h +9 -0
- data/ext/nokogiri/xml_schema.c +276 -0
- data/ext/nokogiri/xml_schema.h +9 -0
- data/ext/nokogiri/xml_syntax_error.c +64 -0
- data/ext/nokogiri/xml_syntax_error.h +13 -0
- data/ext/nokogiri/xml_text.c +52 -0
- data/ext/nokogiri/xml_text.h +9 -0
- data/ext/nokogiri/xml_xpath_context.c +374 -0
- data/ext/nokogiri/xml_xpath_context.h +10 -0
- data/ext/nokogiri/xslt_stylesheet.c +263 -0
- data/ext/nokogiri/xslt_stylesheet.h +14 -0
- data/lib/nokogiri.rb +127 -0
- data/lib/nokogiri/2.5/nokogiri.bundle +0 -0
- data/lib/nokogiri/2.6/nokogiri.bundle +0 -0
- data/lib/nokogiri/2.7/nokogiri.bundle +0 -0
- data/lib/nokogiri/3.0/nokogiri.bundle +0 -0
- data/lib/nokogiri/css.rb +28 -0
- data/lib/nokogiri/css/node.rb +53 -0
- data/lib/nokogiri/css/parser.rb +751 -0
- data/lib/nokogiri/css/parser.y +272 -0
- data/lib/nokogiri/css/parser_extras.rb +94 -0
- data/lib/nokogiri/css/syntax_error.rb +8 -0
- data/lib/nokogiri/css/tokenizer.rb +154 -0
- data/lib/nokogiri/css/tokenizer.rex +55 -0
- data/lib/nokogiri/css/xpath_visitor.rb +260 -0
- data/lib/nokogiri/decorators/slop.rb +43 -0
- data/lib/nokogiri/html.rb +38 -0
- data/lib/nokogiri/html/builder.rb +36 -0
- data/lib/nokogiri/html/document.rb +322 -0
- data/lib/nokogiri/html/document_fragment.rb +50 -0
- data/lib/nokogiri/html/element_description.rb +24 -0
- data/lib/nokogiri/html/element_description_defaults.rb +672 -0
- data/lib/nokogiri/html/entity_lookup.rb +14 -0
- data/lib/nokogiri/html/sax/parser.rb +63 -0
- data/lib/nokogiri/html/sax/parser_context.rb +17 -0
- data/lib/nokogiri/html/sax/push_parser.rb +37 -0
- data/lib/nokogiri/jruby/dependencies.rb +20 -0
- data/lib/nokogiri/syntax_error.rb +5 -0
- data/lib/nokogiri/version.rb +3 -0
- data/lib/nokogiri/version/constant.rb +5 -0
- data/lib/nokogiri/version/info.rb +182 -0
- data/lib/nokogiri/xml.rb +76 -0
- data/lib/nokogiri/xml/attr.rb +15 -0
- data/lib/nokogiri/xml/attribute_decl.rb +19 -0
- data/lib/nokogiri/xml/builder.rb +447 -0
- data/lib/nokogiri/xml/cdata.rb +12 -0
- data/lib/nokogiri/xml/character_data.rb +8 -0
- data/lib/nokogiri/xml/document.rb +290 -0
- data/lib/nokogiri/xml/document_fragment.rb +159 -0
- data/lib/nokogiri/xml/dtd.rb +33 -0
- data/lib/nokogiri/xml/element_content.rb +37 -0
- data/lib/nokogiri/xml/element_decl.rb +14 -0
- data/lib/nokogiri/xml/entity_decl.rb +20 -0
- data/lib/nokogiri/xml/entity_reference.rb +19 -0
- data/lib/nokogiri/xml/namespace.rb +14 -0
- data/lib/nokogiri/xml/node.rb +1240 -0
- data/lib/nokogiri/xml/node/save_options.rb +62 -0
- data/lib/nokogiri/xml/node_set.rb +372 -0
- data/lib/nokogiri/xml/notation.rb +7 -0
- data/lib/nokogiri/xml/parse_options.rb +127 -0
- data/lib/nokogiri/xml/pp.rb +3 -0
- data/lib/nokogiri/xml/pp/character_data.rb +19 -0
- data/lib/nokogiri/xml/pp/node.rb +57 -0
- data/lib/nokogiri/xml/processing_instruction.rb +9 -0
- data/lib/nokogiri/xml/reader.rb +116 -0
- data/lib/nokogiri/xml/relax_ng.rb +37 -0
- data/lib/nokogiri/xml/sax.rb +5 -0
- data/lib/nokogiri/xml/sax/document.rb +172 -0
- data/lib/nokogiri/xml/sax/parser.rb +123 -0
- data/lib/nokogiri/xml/sax/parser_context.rb +17 -0
- data/lib/nokogiri/xml/sax/push_parser.rb +61 -0
- data/lib/nokogiri/xml/schema.rb +72 -0
- data/lib/nokogiri/xml/searchable.rb +239 -0
- data/lib/nokogiri/xml/syntax_error.rb +71 -0
- data/lib/nokogiri/xml/text.rb +10 -0
- data/lib/nokogiri/xml/xpath.rb +11 -0
- data/lib/nokogiri/xml/xpath/syntax_error.rb +12 -0
- data/lib/nokogiri/xml/xpath_context.rb +17 -0
- data/lib/nokogiri/xslt.rb +57 -0
- data/lib/nokogiri/xslt/stylesheet.rb +26 -0
- data/lib/xsd/xmlparser/nokogiri.rb +103 -0
- metadata +565 -0
@@ -0,0 +1,222 @@
|
|
1
|
+
/*
|
2
|
+
* Summary: regular expressions handling
|
3
|
+
* Description: basic API for libxml regular expressions handling used
|
4
|
+
* for XML Schemas and validation.
|
5
|
+
*
|
6
|
+
* Copy: See Copyright for the status of this software.
|
7
|
+
*
|
8
|
+
* Author: Daniel Veillard
|
9
|
+
*/
|
10
|
+
|
11
|
+
#ifndef __XML_REGEXP_H__
|
12
|
+
#define __XML_REGEXP_H__
|
13
|
+
|
14
|
+
#include <libxml/xmlversion.h>
|
15
|
+
|
16
|
+
#ifdef LIBXML_REGEXP_ENABLED
|
17
|
+
|
18
|
+
#ifdef __cplusplus
|
19
|
+
extern "C" {
|
20
|
+
#endif
|
21
|
+
|
22
|
+
/**
|
23
|
+
* xmlRegexpPtr:
|
24
|
+
*
|
25
|
+
* A libxml regular expression, they can actually be far more complex
|
26
|
+
* thank the POSIX regex expressions.
|
27
|
+
*/
|
28
|
+
typedef struct _xmlRegexp xmlRegexp;
|
29
|
+
typedef xmlRegexp *xmlRegexpPtr;
|
30
|
+
|
31
|
+
/**
|
32
|
+
* xmlRegExecCtxtPtr:
|
33
|
+
*
|
34
|
+
* A libxml progressive regular expression evaluation context
|
35
|
+
*/
|
36
|
+
typedef struct _xmlRegExecCtxt xmlRegExecCtxt;
|
37
|
+
typedef xmlRegExecCtxt *xmlRegExecCtxtPtr;
|
38
|
+
|
39
|
+
#ifdef __cplusplus
|
40
|
+
}
|
41
|
+
#endif
|
42
|
+
#include <libxml/tree.h>
|
43
|
+
#include <libxml/dict.h>
|
44
|
+
#ifdef __cplusplus
|
45
|
+
extern "C" {
|
46
|
+
#endif
|
47
|
+
|
48
|
+
/*
|
49
|
+
* The POSIX like API
|
50
|
+
*/
|
51
|
+
XMLPUBFUN xmlRegexpPtr XMLCALL
|
52
|
+
xmlRegexpCompile (const xmlChar *regexp);
|
53
|
+
XMLPUBFUN void XMLCALL xmlRegFreeRegexp(xmlRegexpPtr regexp);
|
54
|
+
XMLPUBFUN int XMLCALL
|
55
|
+
xmlRegexpExec (xmlRegexpPtr comp,
|
56
|
+
const xmlChar *value);
|
57
|
+
XMLPUBFUN void XMLCALL
|
58
|
+
xmlRegexpPrint (FILE *output,
|
59
|
+
xmlRegexpPtr regexp);
|
60
|
+
XMLPUBFUN int XMLCALL
|
61
|
+
xmlRegexpIsDeterminist(xmlRegexpPtr comp);
|
62
|
+
|
63
|
+
/**
|
64
|
+
* xmlRegExecCallbacks:
|
65
|
+
* @exec: the regular expression context
|
66
|
+
* @token: the current token string
|
67
|
+
* @transdata: transition data
|
68
|
+
* @inputdata: input data
|
69
|
+
*
|
70
|
+
* Callback function when doing a transition in the automata
|
71
|
+
*/
|
72
|
+
typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec,
|
73
|
+
const xmlChar *token,
|
74
|
+
void *transdata,
|
75
|
+
void *inputdata);
|
76
|
+
|
77
|
+
/*
|
78
|
+
* The progressive API
|
79
|
+
*/
|
80
|
+
XMLPUBFUN xmlRegExecCtxtPtr XMLCALL
|
81
|
+
xmlRegNewExecCtxt (xmlRegexpPtr comp,
|
82
|
+
xmlRegExecCallbacks callback,
|
83
|
+
void *data);
|
84
|
+
XMLPUBFUN void XMLCALL
|
85
|
+
xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec);
|
86
|
+
XMLPUBFUN int XMLCALL
|
87
|
+
xmlRegExecPushString(xmlRegExecCtxtPtr exec,
|
88
|
+
const xmlChar *value,
|
89
|
+
void *data);
|
90
|
+
XMLPUBFUN int XMLCALL
|
91
|
+
xmlRegExecPushString2(xmlRegExecCtxtPtr exec,
|
92
|
+
const xmlChar *value,
|
93
|
+
const xmlChar *value2,
|
94
|
+
void *data);
|
95
|
+
|
96
|
+
XMLPUBFUN int XMLCALL
|
97
|
+
xmlRegExecNextValues(xmlRegExecCtxtPtr exec,
|
98
|
+
int *nbval,
|
99
|
+
int *nbneg,
|
100
|
+
xmlChar **values,
|
101
|
+
int *terminal);
|
102
|
+
XMLPUBFUN int XMLCALL
|
103
|
+
xmlRegExecErrInfo (xmlRegExecCtxtPtr exec,
|
104
|
+
const xmlChar **string,
|
105
|
+
int *nbval,
|
106
|
+
int *nbneg,
|
107
|
+
xmlChar **values,
|
108
|
+
int *terminal);
|
109
|
+
#ifdef LIBXML_EXPR_ENABLED
|
110
|
+
/*
|
111
|
+
* Formal regular expression handling
|
112
|
+
* Its goal is to do some formal work on content models
|
113
|
+
*/
|
114
|
+
|
115
|
+
/* expressions are used within a context */
|
116
|
+
typedef struct _xmlExpCtxt xmlExpCtxt;
|
117
|
+
typedef xmlExpCtxt *xmlExpCtxtPtr;
|
118
|
+
|
119
|
+
XMLPUBFUN void XMLCALL
|
120
|
+
xmlExpFreeCtxt (xmlExpCtxtPtr ctxt);
|
121
|
+
XMLPUBFUN xmlExpCtxtPtr XMLCALL
|
122
|
+
xmlExpNewCtxt (int maxNodes,
|
123
|
+
xmlDictPtr dict);
|
124
|
+
|
125
|
+
XMLPUBFUN int XMLCALL
|
126
|
+
xmlExpCtxtNbNodes(xmlExpCtxtPtr ctxt);
|
127
|
+
XMLPUBFUN int XMLCALL
|
128
|
+
xmlExpCtxtNbCons(xmlExpCtxtPtr ctxt);
|
129
|
+
|
130
|
+
/* Expressions are trees but the tree is opaque */
|
131
|
+
typedef struct _xmlExpNode xmlExpNode;
|
132
|
+
typedef xmlExpNode *xmlExpNodePtr;
|
133
|
+
|
134
|
+
typedef enum {
|
135
|
+
XML_EXP_EMPTY = 0,
|
136
|
+
XML_EXP_FORBID = 1,
|
137
|
+
XML_EXP_ATOM = 2,
|
138
|
+
XML_EXP_SEQ = 3,
|
139
|
+
XML_EXP_OR = 4,
|
140
|
+
XML_EXP_COUNT = 5
|
141
|
+
} xmlExpNodeType;
|
142
|
+
|
143
|
+
/*
|
144
|
+
* 2 core expressions shared by all for the empty language set
|
145
|
+
* and for the set with just the empty token
|
146
|
+
*/
|
147
|
+
XMLPUBVAR xmlExpNodePtr forbiddenExp;
|
148
|
+
XMLPUBVAR xmlExpNodePtr emptyExp;
|
149
|
+
|
150
|
+
/*
|
151
|
+
* Expressions are reference counted internally
|
152
|
+
*/
|
153
|
+
XMLPUBFUN void XMLCALL
|
154
|
+
xmlExpFree (xmlExpCtxtPtr ctxt,
|
155
|
+
xmlExpNodePtr expr);
|
156
|
+
XMLPUBFUN void XMLCALL
|
157
|
+
xmlExpRef (xmlExpNodePtr expr);
|
158
|
+
|
159
|
+
/*
|
160
|
+
* constructors can be either manual or from a string
|
161
|
+
*/
|
162
|
+
XMLPUBFUN xmlExpNodePtr XMLCALL
|
163
|
+
xmlExpParse (xmlExpCtxtPtr ctxt,
|
164
|
+
const char *expr);
|
165
|
+
XMLPUBFUN xmlExpNodePtr XMLCALL
|
166
|
+
xmlExpNewAtom (xmlExpCtxtPtr ctxt,
|
167
|
+
const xmlChar *name,
|
168
|
+
int len);
|
169
|
+
XMLPUBFUN xmlExpNodePtr XMLCALL
|
170
|
+
xmlExpNewOr (xmlExpCtxtPtr ctxt,
|
171
|
+
xmlExpNodePtr left,
|
172
|
+
xmlExpNodePtr right);
|
173
|
+
XMLPUBFUN xmlExpNodePtr XMLCALL
|
174
|
+
xmlExpNewSeq (xmlExpCtxtPtr ctxt,
|
175
|
+
xmlExpNodePtr left,
|
176
|
+
xmlExpNodePtr right);
|
177
|
+
XMLPUBFUN xmlExpNodePtr XMLCALL
|
178
|
+
xmlExpNewRange (xmlExpCtxtPtr ctxt,
|
179
|
+
xmlExpNodePtr subset,
|
180
|
+
int min,
|
181
|
+
int max);
|
182
|
+
/*
|
183
|
+
* The really interesting APIs
|
184
|
+
*/
|
185
|
+
XMLPUBFUN int XMLCALL
|
186
|
+
xmlExpIsNillable(xmlExpNodePtr expr);
|
187
|
+
XMLPUBFUN int XMLCALL
|
188
|
+
xmlExpMaxToken (xmlExpNodePtr expr);
|
189
|
+
XMLPUBFUN int XMLCALL
|
190
|
+
xmlExpGetLanguage(xmlExpCtxtPtr ctxt,
|
191
|
+
xmlExpNodePtr expr,
|
192
|
+
const xmlChar**langList,
|
193
|
+
int len);
|
194
|
+
XMLPUBFUN int XMLCALL
|
195
|
+
xmlExpGetStart (xmlExpCtxtPtr ctxt,
|
196
|
+
xmlExpNodePtr expr,
|
197
|
+
const xmlChar**tokList,
|
198
|
+
int len);
|
199
|
+
XMLPUBFUN xmlExpNodePtr XMLCALL
|
200
|
+
xmlExpStringDerive(xmlExpCtxtPtr ctxt,
|
201
|
+
xmlExpNodePtr expr,
|
202
|
+
const xmlChar *str,
|
203
|
+
int len);
|
204
|
+
XMLPUBFUN xmlExpNodePtr XMLCALL
|
205
|
+
xmlExpExpDerive (xmlExpCtxtPtr ctxt,
|
206
|
+
xmlExpNodePtr expr,
|
207
|
+
xmlExpNodePtr sub);
|
208
|
+
XMLPUBFUN int XMLCALL
|
209
|
+
xmlExpSubsume (xmlExpCtxtPtr ctxt,
|
210
|
+
xmlExpNodePtr expr,
|
211
|
+
xmlExpNodePtr sub);
|
212
|
+
XMLPUBFUN void XMLCALL
|
213
|
+
xmlExpDump (xmlBufferPtr buf,
|
214
|
+
xmlExpNodePtr expr);
|
215
|
+
#endif /* LIBXML_EXPR_ENABLED */
|
216
|
+
#ifdef __cplusplus
|
217
|
+
}
|
218
|
+
#endif
|
219
|
+
|
220
|
+
#endif /* LIBXML_REGEXP_ENABLED */
|
221
|
+
|
222
|
+
#endif /*__XML_REGEXP_H__ */
|
@@ -0,0 +1,88 @@
|
|
1
|
+
/*
|
2
|
+
* Summary: the XML document serializer
|
3
|
+
* Description: API to save document or subtree of document
|
4
|
+
*
|
5
|
+
* Copy: See Copyright for the status of this software.
|
6
|
+
*
|
7
|
+
* Author: Daniel Veillard
|
8
|
+
*/
|
9
|
+
|
10
|
+
#ifndef __XML_XMLSAVE_H__
|
11
|
+
#define __XML_XMLSAVE_H__
|
12
|
+
|
13
|
+
#include <libxml/xmlversion.h>
|
14
|
+
#include <libxml/tree.h>
|
15
|
+
#include <libxml/encoding.h>
|
16
|
+
#include <libxml/xmlIO.h>
|
17
|
+
|
18
|
+
#ifdef LIBXML_OUTPUT_ENABLED
|
19
|
+
#ifdef __cplusplus
|
20
|
+
extern "C" {
|
21
|
+
#endif
|
22
|
+
|
23
|
+
/**
|
24
|
+
* xmlSaveOption:
|
25
|
+
*
|
26
|
+
* This is the set of XML save options that can be passed down
|
27
|
+
* to the xmlSaveToFd() and similar calls.
|
28
|
+
*/
|
29
|
+
typedef enum {
|
30
|
+
XML_SAVE_FORMAT = 1<<0, /* format save output */
|
31
|
+
XML_SAVE_NO_DECL = 1<<1, /* drop the xml declaration */
|
32
|
+
XML_SAVE_NO_EMPTY = 1<<2, /* no empty tags */
|
33
|
+
XML_SAVE_NO_XHTML = 1<<3, /* disable XHTML1 specific rules */
|
34
|
+
XML_SAVE_XHTML = 1<<4, /* force XHTML1 specific rules */
|
35
|
+
XML_SAVE_AS_XML = 1<<5, /* force XML serialization on HTML doc */
|
36
|
+
XML_SAVE_AS_HTML = 1<<6, /* force HTML serialization on XML doc */
|
37
|
+
XML_SAVE_WSNONSIG = 1<<7 /* format with non-significant whitespace */
|
38
|
+
} xmlSaveOption;
|
39
|
+
|
40
|
+
|
41
|
+
typedef struct _xmlSaveCtxt xmlSaveCtxt;
|
42
|
+
typedef xmlSaveCtxt *xmlSaveCtxtPtr;
|
43
|
+
|
44
|
+
XMLPUBFUN xmlSaveCtxtPtr XMLCALL
|
45
|
+
xmlSaveToFd (int fd,
|
46
|
+
const char *encoding,
|
47
|
+
int options);
|
48
|
+
XMLPUBFUN xmlSaveCtxtPtr XMLCALL
|
49
|
+
xmlSaveToFilename (const char *filename,
|
50
|
+
const char *encoding,
|
51
|
+
int options);
|
52
|
+
|
53
|
+
XMLPUBFUN xmlSaveCtxtPtr XMLCALL
|
54
|
+
xmlSaveToBuffer (xmlBufferPtr buffer,
|
55
|
+
const char *encoding,
|
56
|
+
int options);
|
57
|
+
|
58
|
+
XMLPUBFUN xmlSaveCtxtPtr XMLCALL
|
59
|
+
xmlSaveToIO (xmlOutputWriteCallback iowrite,
|
60
|
+
xmlOutputCloseCallback ioclose,
|
61
|
+
void *ioctx,
|
62
|
+
const char *encoding,
|
63
|
+
int options);
|
64
|
+
|
65
|
+
XMLPUBFUN long XMLCALL
|
66
|
+
xmlSaveDoc (xmlSaveCtxtPtr ctxt,
|
67
|
+
xmlDocPtr doc);
|
68
|
+
XMLPUBFUN long XMLCALL
|
69
|
+
xmlSaveTree (xmlSaveCtxtPtr ctxt,
|
70
|
+
xmlNodePtr node);
|
71
|
+
|
72
|
+
XMLPUBFUN int XMLCALL
|
73
|
+
xmlSaveFlush (xmlSaveCtxtPtr ctxt);
|
74
|
+
XMLPUBFUN int XMLCALL
|
75
|
+
xmlSaveClose (xmlSaveCtxtPtr ctxt);
|
76
|
+
XMLPUBFUN int XMLCALL
|
77
|
+
xmlSaveSetEscape (xmlSaveCtxtPtr ctxt,
|
78
|
+
xmlCharEncodingOutputFunc escape);
|
79
|
+
XMLPUBFUN int XMLCALL
|
80
|
+
xmlSaveSetAttrEscape (xmlSaveCtxtPtr ctxt,
|
81
|
+
xmlCharEncodingOutputFunc escape);
|
82
|
+
#ifdef __cplusplus
|
83
|
+
}
|
84
|
+
#endif
|
85
|
+
#endif /* LIBXML_OUTPUT_ENABLED */
|
86
|
+
#endif /* __XML_XMLSAVE_H__ */
|
87
|
+
|
88
|
+
|
@@ -0,0 +1,246 @@
|
|
1
|
+
/*
|
2
|
+
* Summary: incomplete XML Schemas structure implementation
|
3
|
+
* Description: interface to the XML Schemas handling and schema validity
|
4
|
+
* checking, it is incomplete right now.
|
5
|
+
*
|
6
|
+
* Copy: See Copyright for the status of this software.
|
7
|
+
*
|
8
|
+
* Author: Daniel Veillard
|
9
|
+
*/
|
10
|
+
|
11
|
+
|
12
|
+
#ifndef __XML_SCHEMA_H__
|
13
|
+
#define __XML_SCHEMA_H__
|
14
|
+
|
15
|
+
#include <libxml/xmlversion.h>
|
16
|
+
|
17
|
+
#ifdef LIBXML_SCHEMAS_ENABLED
|
18
|
+
|
19
|
+
#include <libxml/tree.h>
|
20
|
+
|
21
|
+
#ifdef __cplusplus
|
22
|
+
extern "C" {
|
23
|
+
#endif
|
24
|
+
|
25
|
+
/**
|
26
|
+
* This error codes are obsolete; not used any more.
|
27
|
+
*/
|
28
|
+
typedef enum {
|
29
|
+
XML_SCHEMAS_ERR_OK = 0,
|
30
|
+
XML_SCHEMAS_ERR_NOROOT = 1,
|
31
|
+
XML_SCHEMAS_ERR_UNDECLAREDELEM,
|
32
|
+
XML_SCHEMAS_ERR_NOTTOPLEVEL,
|
33
|
+
XML_SCHEMAS_ERR_MISSING,
|
34
|
+
XML_SCHEMAS_ERR_WRONGELEM,
|
35
|
+
XML_SCHEMAS_ERR_NOTYPE,
|
36
|
+
XML_SCHEMAS_ERR_NOROLLBACK,
|
37
|
+
XML_SCHEMAS_ERR_ISABSTRACT,
|
38
|
+
XML_SCHEMAS_ERR_NOTEMPTY,
|
39
|
+
XML_SCHEMAS_ERR_ELEMCONT,
|
40
|
+
XML_SCHEMAS_ERR_HAVEDEFAULT,
|
41
|
+
XML_SCHEMAS_ERR_NOTNILLABLE,
|
42
|
+
XML_SCHEMAS_ERR_EXTRACONTENT,
|
43
|
+
XML_SCHEMAS_ERR_INVALIDATTR,
|
44
|
+
XML_SCHEMAS_ERR_INVALIDELEM,
|
45
|
+
XML_SCHEMAS_ERR_NOTDETERMINIST,
|
46
|
+
XML_SCHEMAS_ERR_CONSTRUCT,
|
47
|
+
XML_SCHEMAS_ERR_INTERNAL,
|
48
|
+
XML_SCHEMAS_ERR_NOTSIMPLE,
|
49
|
+
XML_SCHEMAS_ERR_ATTRUNKNOWN,
|
50
|
+
XML_SCHEMAS_ERR_ATTRINVALID,
|
51
|
+
XML_SCHEMAS_ERR_VALUE,
|
52
|
+
XML_SCHEMAS_ERR_FACET,
|
53
|
+
XML_SCHEMAS_ERR_,
|
54
|
+
XML_SCHEMAS_ERR_XXX
|
55
|
+
} xmlSchemaValidError;
|
56
|
+
|
57
|
+
/*
|
58
|
+
* ATTENTION: Change xmlSchemaSetValidOptions's check
|
59
|
+
* for invalid values, if adding to the validation
|
60
|
+
* options below.
|
61
|
+
*/
|
62
|
+
/**
|
63
|
+
* xmlSchemaValidOption:
|
64
|
+
*
|
65
|
+
* This is the set of XML Schema validation options.
|
66
|
+
*/
|
67
|
+
typedef enum {
|
68
|
+
XML_SCHEMA_VAL_VC_I_CREATE = 1<<0
|
69
|
+
/* Default/fixed: create an attribute node
|
70
|
+
* or an element's text node on the instance.
|
71
|
+
*/
|
72
|
+
} xmlSchemaValidOption;
|
73
|
+
|
74
|
+
/*
|
75
|
+
XML_SCHEMA_VAL_XSI_ASSEMBLE = 1<<1,
|
76
|
+
* assemble schemata using
|
77
|
+
* xsi:schemaLocation and
|
78
|
+
* xsi:noNamespaceSchemaLocation
|
79
|
+
*/
|
80
|
+
|
81
|
+
/**
|
82
|
+
* The schemas related types are kept internal
|
83
|
+
*/
|
84
|
+
typedef struct _xmlSchema xmlSchema;
|
85
|
+
typedef xmlSchema *xmlSchemaPtr;
|
86
|
+
|
87
|
+
/**
|
88
|
+
* xmlSchemaValidityErrorFunc:
|
89
|
+
* @ctx: the validation context
|
90
|
+
* @msg: the message
|
91
|
+
* @...: extra arguments
|
92
|
+
*
|
93
|
+
* Signature of an error callback from an XSD validation
|
94
|
+
*/
|
95
|
+
typedef void (XMLCDECL *xmlSchemaValidityErrorFunc)
|
96
|
+
(void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
|
97
|
+
|
98
|
+
/**
|
99
|
+
* xmlSchemaValidityWarningFunc:
|
100
|
+
* @ctx: the validation context
|
101
|
+
* @msg: the message
|
102
|
+
* @...: extra arguments
|
103
|
+
*
|
104
|
+
* Signature of a warning callback from an XSD validation
|
105
|
+
*/
|
106
|
+
typedef void (XMLCDECL *xmlSchemaValidityWarningFunc)
|
107
|
+
(void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
|
108
|
+
|
109
|
+
/**
|
110
|
+
* A schemas validation context
|
111
|
+
*/
|
112
|
+
typedef struct _xmlSchemaParserCtxt xmlSchemaParserCtxt;
|
113
|
+
typedef xmlSchemaParserCtxt *xmlSchemaParserCtxtPtr;
|
114
|
+
|
115
|
+
typedef struct _xmlSchemaValidCtxt xmlSchemaValidCtxt;
|
116
|
+
typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr;
|
117
|
+
|
118
|
+
/**
|
119
|
+
* xmlSchemaValidityLocatorFunc:
|
120
|
+
* @ctx: user provided context
|
121
|
+
* @file: returned file information
|
122
|
+
* @line: returned line information
|
123
|
+
*
|
124
|
+
* A schemas validation locator, a callback called by the validator.
|
125
|
+
* This is used when file or node informations are not available
|
126
|
+
* to find out what file and line number are affected
|
127
|
+
*
|
128
|
+
* Returns: 0 in case of success and -1 in case of error
|
129
|
+
*/
|
130
|
+
|
131
|
+
typedef int (XMLCDECL *xmlSchemaValidityLocatorFunc) (void *ctx,
|
132
|
+
const char **file, unsigned long *line);
|
133
|
+
|
134
|
+
/*
|
135
|
+
* Interfaces for parsing.
|
136
|
+
*/
|
137
|
+
XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
|
138
|
+
xmlSchemaNewParserCtxt (const char *URL);
|
139
|
+
XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
|
140
|
+
xmlSchemaNewMemParserCtxt (const char *buffer,
|
141
|
+
int size);
|
142
|
+
XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
|
143
|
+
xmlSchemaNewDocParserCtxt (xmlDocPtr doc);
|
144
|
+
XMLPUBFUN void XMLCALL
|
145
|
+
xmlSchemaFreeParserCtxt (xmlSchemaParserCtxtPtr ctxt);
|
146
|
+
XMLPUBFUN void XMLCALL
|
147
|
+
xmlSchemaSetParserErrors (xmlSchemaParserCtxtPtr ctxt,
|
148
|
+
xmlSchemaValidityErrorFunc err,
|
149
|
+
xmlSchemaValidityWarningFunc warn,
|
150
|
+
void *ctx);
|
151
|
+
XMLPUBFUN void XMLCALL
|
152
|
+
xmlSchemaSetParserStructuredErrors(xmlSchemaParserCtxtPtr ctxt,
|
153
|
+
xmlStructuredErrorFunc serror,
|
154
|
+
void *ctx);
|
155
|
+
XMLPUBFUN int XMLCALL
|
156
|
+
xmlSchemaGetParserErrors(xmlSchemaParserCtxtPtr ctxt,
|
157
|
+
xmlSchemaValidityErrorFunc * err,
|
158
|
+
xmlSchemaValidityWarningFunc * warn,
|
159
|
+
void **ctx);
|
160
|
+
XMLPUBFUN int XMLCALL
|
161
|
+
xmlSchemaIsValid (xmlSchemaValidCtxtPtr ctxt);
|
162
|
+
|
163
|
+
XMLPUBFUN xmlSchemaPtr XMLCALL
|
164
|
+
xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt);
|
165
|
+
XMLPUBFUN void XMLCALL
|
166
|
+
xmlSchemaFree (xmlSchemaPtr schema);
|
167
|
+
#ifdef LIBXML_OUTPUT_ENABLED
|
168
|
+
XMLPUBFUN void XMLCALL
|
169
|
+
xmlSchemaDump (FILE *output,
|
170
|
+
xmlSchemaPtr schema);
|
171
|
+
#endif /* LIBXML_OUTPUT_ENABLED */
|
172
|
+
/*
|
173
|
+
* Interfaces for validating
|
174
|
+
*/
|
175
|
+
XMLPUBFUN void XMLCALL
|
176
|
+
xmlSchemaSetValidErrors (xmlSchemaValidCtxtPtr ctxt,
|
177
|
+
xmlSchemaValidityErrorFunc err,
|
178
|
+
xmlSchemaValidityWarningFunc warn,
|
179
|
+
void *ctx);
|
180
|
+
XMLPUBFUN void XMLCALL
|
181
|
+
xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr ctxt,
|
182
|
+
xmlStructuredErrorFunc serror,
|
183
|
+
void *ctx);
|
184
|
+
XMLPUBFUN int XMLCALL
|
185
|
+
xmlSchemaGetValidErrors (xmlSchemaValidCtxtPtr ctxt,
|
186
|
+
xmlSchemaValidityErrorFunc *err,
|
187
|
+
xmlSchemaValidityWarningFunc *warn,
|
188
|
+
void **ctx);
|
189
|
+
XMLPUBFUN int XMLCALL
|
190
|
+
xmlSchemaSetValidOptions (xmlSchemaValidCtxtPtr ctxt,
|
191
|
+
int options);
|
192
|
+
XMLPUBFUN void XMLCALL
|
193
|
+
xmlSchemaValidateSetFilename(xmlSchemaValidCtxtPtr vctxt,
|
194
|
+
const char *filename);
|
195
|
+
XMLPUBFUN int XMLCALL
|
196
|
+
xmlSchemaValidCtxtGetOptions(xmlSchemaValidCtxtPtr ctxt);
|
197
|
+
|
198
|
+
XMLPUBFUN xmlSchemaValidCtxtPtr XMLCALL
|
199
|
+
xmlSchemaNewValidCtxt (xmlSchemaPtr schema);
|
200
|
+
XMLPUBFUN void XMLCALL
|
201
|
+
xmlSchemaFreeValidCtxt (xmlSchemaValidCtxtPtr ctxt);
|
202
|
+
XMLPUBFUN int XMLCALL
|
203
|
+
xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt,
|
204
|
+
xmlDocPtr instance);
|
205
|
+
XMLPUBFUN int XMLCALL
|
206
|
+
xmlSchemaValidateOneElement (xmlSchemaValidCtxtPtr ctxt,
|
207
|
+
xmlNodePtr elem);
|
208
|
+
XMLPUBFUN int XMLCALL
|
209
|
+
xmlSchemaValidateStream (xmlSchemaValidCtxtPtr ctxt,
|
210
|
+
xmlParserInputBufferPtr input,
|
211
|
+
xmlCharEncoding enc,
|
212
|
+
xmlSAXHandlerPtr sax,
|
213
|
+
void *user_data);
|
214
|
+
XMLPUBFUN int XMLCALL
|
215
|
+
xmlSchemaValidateFile (xmlSchemaValidCtxtPtr ctxt,
|
216
|
+
const char * filename,
|
217
|
+
int options);
|
218
|
+
|
219
|
+
XMLPUBFUN xmlParserCtxtPtr XMLCALL
|
220
|
+
xmlSchemaValidCtxtGetParserCtxt(xmlSchemaValidCtxtPtr ctxt);
|
221
|
+
|
222
|
+
/*
|
223
|
+
* Interface to insert Schemas SAX validation in a SAX stream
|
224
|
+
*/
|
225
|
+
typedef struct _xmlSchemaSAXPlug xmlSchemaSAXPlugStruct;
|
226
|
+
typedef xmlSchemaSAXPlugStruct *xmlSchemaSAXPlugPtr;
|
227
|
+
|
228
|
+
XMLPUBFUN xmlSchemaSAXPlugPtr XMLCALL
|
229
|
+
xmlSchemaSAXPlug (xmlSchemaValidCtxtPtr ctxt,
|
230
|
+
xmlSAXHandlerPtr *sax,
|
231
|
+
void **user_data);
|
232
|
+
XMLPUBFUN int XMLCALL
|
233
|
+
xmlSchemaSAXUnplug (xmlSchemaSAXPlugPtr plug);
|
234
|
+
|
235
|
+
|
236
|
+
XMLPUBFUN void XMLCALL
|
237
|
+
xmlSchemaValidateSetLocator (xmlSchemaValidCtxtPtr vctxt,
|
238
|
+
xmlSchemaValidityLocatorFunc f,
|
239
|
+
void *ctxt);
|
240
|
+
|
241
|
+
#ifdef __cplusplus
|
242
|
+
}
|
243
|
+
#endif
|
244
|
+
|
245
|
+
#endif /* LIBXML_SCHEMAS_ENABLED */
|
246
|
+
#endif /* __XML_SCHEMA_H__ */
|