nokogiri 1.11.0.rc1-x86-linux → 1.11.1-x86-linux

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.

Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -0
  3. data/LICENSE-DEPENDENCIES.md +1015 -947
  4. data/README.md +164 -92
  5. data/ext/nokogiri/depend +476 -357
  6. data/ext/nokogiri/extconf.rb +467 -326
  7. data/ext/nokogiri/html_document.c +79 -78
  8. data/ext/nokogiri/html_sax_parser_context.c +4 -2
  9. data/ext/nokogiri/html_sax_push_parser.c +14 -8
  10. data/ext/nokogiri/include/libexslt/exslt.h +102 -0
  11. data/ext/nokogiri/include/libexslt/exsltconfig.h +70 -0
  12. data/ext/nokogiri/include/libexslt/exsltexports.h +140 -0
  13. data/ext/nokogiri/include/libxml2/libxml/DOCBparser.h +96 -0
  14. data/ext/nokogiri/include/libxml2/libxml/HTMLparser.h +306 -0
  15. data/ext/nokogiri/include/libxml2/libxml/HTMLtree.h +147 -0
  16. data/ext/nokogiri/include/libxml2/libxml/SAX.h +173 -0
  17. data/ext/nokogiri/include/libxml2/libxml/SAX2.h +178 -0
  18. data/ext/nokogiri/include/libxml2/libxml/c14n.h +126 -0
  19. data/ext/nokogiri/include/libxml2/libxml/catalog.h +182 -0
  20. data/ext/nokogiri/include/libxml2/libxml/chvalid.h +230 -0
  21. data/ext/nokogiri/include/libxml2/libxml/debugXML.h +217 -0
  22. data/ext/nokogiri/include/libxml2/libxml/dict.h +79 -0
  23. data/ext/nokogiri/include/libxml2/libxml/encoding.h +245 -0
  24. data/ext/nokogiri/include/libxml2/libxml/entities.h +151 -0
  25. data/ext/nokogiri/include/libxml2/libxml/globals.h +508 -0
  26. data/ext/nokogiri/include/libxml2/libxml/hash.h +236 -0
  27. data/ext/nokogiri/include/libxml2/libxml/list.h +137 -0
  28. data/ext/nokogiri/include/libxml2/libxml/nanoftp.h +163 -0
  29. data/ext/nokogiri/include/libxml2/libxml/nanohttp.h +81 -0
  30. data/ext/nokogiri/include/libxml2/libxml/parser.h +1241 -0
  31. data/ext/nokogiri/include/libxml2/libxml/parserInternals.h +644 -0
  32. data/ext/nokogiri/include/libxml2/libxml/pattern.h +100 -0
  33. data/ext/nokogiri/include/libxml2/libxml/relaxng.h +217 -0
  34. data/ext/nokogiri/include/libxml2/libxml/schemasInternals.h +958 -0
  35. data/ext/nokogiri/include/libxml2/libxml/schematron.h +142 -0
  36. data/ext/nokogiri/include/libxml2/libxml/threads.h +89 -0
  37. data/ext/nokogiri/include/libxml2/libxml/tree.h +1311 -0
  38. data/ext/nokogiri/include/libxml2/libxml/uri.h +94 -0
  39. data/ext/nokogiri/include/libxml2/libxml/valid.h +458 -0
  40. data/ext/nokogiri/include/libxml2/libxml/xinclude.h +129 -0
  41. data/ext/nokogiri/include/libxml2/libxml/xlink.h +189 -0
  42. data/ext/nokogiri/include/libxml2/libxml/xmlIO.h +366 -0
  43. data/ext/nokogiri/include/libxml2/libxml/xmlautomata.h +146 -0
  44. data/ext/nokogiri/include/libxml2/libxml/xmlerror.h +945 -0
  45. data/ext/nokogiri/include/libxml2/libxml/xmlexports.h +153 -0
  46. data/ext/nokogiri/include/libxml2/libxml/xmlmemory.h +224 -0
  47. data/ext/nokogiri/include/libxml2/libxml/xmlmodule.h +57 -0
  48. data/ext/nokogiri/include/libxml2/libxml/xmlreader.h +428 -0
  49. data/ext/nokogiri/include/libxml2/libxml/xmlregexp.h +222 -0
  50. data/ext/nokogiri/include/libxml2/libxml/xmlsave.h +88 -0
  51. data/ext/nokogiri/include/libxml2/libxml/xmlschemas.h +246 -0
  52. data/ext/nokogiri/include/libxml2/libxml/xmlschemastypes.h +151 -0
  53. data/ext/nokogiri/include/libxml2/libxml/xmlstring.h +140 -0
  54. data/ext/nokogiri/include/libxml2/libxml/xmlunicode.h +202 -0
  55. data/ext/nokogiri/include/libxml2/libxml/xmlversion.h +485 -0
  56. data/ext/nokogiri/include/libxml2/libxml/xmlwriter.h +488 -0
  57. data/ext/nokogiri/include/libxml2/libxml/xpath.h +566 -0
  58. data/ext/nokogiri/include/libxml2/libxml/xpathInternals.h +632 -0
  59. data/ext/nokogiri/include/libxml2/libxml/xpointer.h +114 -0
  60. data/ext/nokogiri/include/libxslt/attributes.h +38 -0
  61. data/ext/nokogiri/include/libxslt/documents.h +93 -0
  62. data/ext/nokogiri/include/libxslt/extensions.h +262 -0
  63. data/ext/nokogiri/include/libxslt/extra.h +72 -0
  64. data/ext/nokogiri/include/libxslt/functions.h +78 -0
  65. data/ext/nokogiri/include/libxslt/imports.h +75 -0
  66. data/ext/nokogiri/include/libxslt/keys.h +53 -0
  67. data/ext/nokogiri/include/libxslt/namespaces.h +68 -0
  68. data/ext/nokogiri/include/libxslt/numbersInternals.h +73 -0
  69. data/ext/nokogiri/include/libxslt/pattern.h +84 -0
  70. data/ext/nokogiri/include/libxslt/preproc.h +43 -0
  71. data/ext/nokogiri/include/libxslt/security.h +104 -0
  72. data/ext/nokogiri/include/libxslt/templates.h +77 -0
  73. data/ext/nokogiri/include/libxslt/transform.h +207 -0
  74. data/ext/nokogiri/include/libxslt/variables.h +118 -0
  75. data/ext/nokogiri/include/libxslt/xslt.h +110 -0
  76. data/ext/nokogiri/include/libxslt/xsltInternals.h +1978 -0
  77. data/ext/nokogiri/include/libxslt/xsltconfig.h +180 -0
  78. data/ext/nokogiri/include/libxslt/xsltexports.h +142 -0
  79. data/ext/nokogiri/include/libxslt/xsltlocale.h +76 -0
  80. data/ext/nokogiri/include/libxslt/xsltutils.h +313 -0
  81. data/ext/nokogiri/nokogiri.c +37 -46
  82. data/ext/nokogiri/nokogiri.h +25 -17
  83. data/ext/nokogiri/test_global_handlers.c +41 -0
  84. data/ext/nokogiri/xml_document.c +8 -3
  85. data/ext/nokogiri/xml_io.c +8 -6
  86. data/ext/nokogiri/xml_node.c +1 -1
  87. data/ext/nokogiri/xml_node_set.c +1 -1
  88. data/ext/nokogiri/xml_reader.c +6 -17
  89. data/ext/nokogiri/xml_relax_ng.c +29 -11
  90. data/ext/nokogiri/xml_sax_parser.c +2 -7
  91. data/ext/nokogiri/xml_sax_parser_context.c +4 -2
  92. data/ext/nokogiri/xml_sax_push_parser.c +2 -0
  93. data/ext/nokogiri/xml_schema.c +84 -13
  94. data/ext/nokogiri/xml_syntax_error.c +23 -0
  95. data/ext/nokogiri/xml_syntax_error.h +15 -3
  96. data/ext/nokogiri/xml_xpath_context.c +80 -4
  97. data/ext/nokogiri/xslt_stylesheet.c +1 -4
  98. data/lib/nokogiri.rb +20 -3
  99. data/lib/nokogiri/2.5/nokogiri.so +0 -0
  100. data/lib/nokogiri/2.6/nokogiri.so +0 -0
  101. data/lib/nokogiri/2.7/nokogiri.so +0 -0
  102. data/lib/nokogiri/3.0/nokogiri.so +0 -0
  103. data/lib/nokogiri/css/parser.rb +62 -62
  104. data/lib/nokogiri/css/parser.y +2 -2
  105. data/lib/nokogiri/css/parser_extras.rb +38 -36
  106. data/lib/nokogiri/css/xpath_visitor.rb +70 -42
  107. data/lib/nokogiri/html/document.rb +12 -26
  108. data/lib/nokogiri/version.rb +2 -148
  109. data/lib/nokogiri/version/constant.rb +5 -0
  110. data/lib/nokogiri/version/info.rb +182 -0
  111. data/lib/nokogiri/xml/builder.rb +2 -2
  112. data/lib/nokogiri/xml/document.rb +17 -7
  113. data/lib/nokogiri/xml/document_fragment.rb +4 -6
  114. data/lib/nokogiri/xml/node.rb +562 -238
  115. data/lib/nokogiri/xml/parse_options.rb +6 -0
  116. data/lib/nokogiri/xml/relax_ng.rb +6 -2
  117. data/lib/nokogiri/xml/schema.rb +12 -4
  118. data/lib/nokogiri/xml/searchable.rb +24 -16
  119. metadata +149 -130
  120. data/lib/nokogiri/2.4/nokogiri.so +0 -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__ */