libxml-ruby 2.8.0 → 3.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/HISTORY +842 -775
- data/LICENSE +20 -20
- data/MANIFEST +166 -166
- data/README.rdoc +217 -184
- data/Rakefile +90 -78
- data/ext/libxml/extconf.h +3 -0
- data/ext/libxml/extconf.rb +61 -116
- data/ext/libxml/libxml.c +80 -76
- data/ext/libxml/ruby_libxml.h +67 -75
- data/ext/libxml/ruby_xml.c +933 -893
- data/ext/libxml/ruby_xml.h +10 -10
- data/ext/libxml/ruby_xml_attr.c +333 -333
- data/ext/libxml/ruby_xml_attr.h +12 -12
- data/ext/libxml/ruby_xml_attr_decl.c +153 -153
- data/ext/libxml/ruby_xml_attr_decl.h +11 -11
- data/ext/libxml/ruby_xml_attributes.c +275 -275
- data/ext/libxml/ruby_xml_attributes.h +15 -15
- data/ext/libxml/ruby_xml_cbg.c +85 -85
- data/ext/libxml/ruby_xml_document.c +1123 -1147
- data/ext/libxml/ruby_xml_document.h +11 -11
- data/ext/libxml/ruby_xml_dtd.c +248 -268
- data/ext/libxml/ruby_xml_dtd.h +9 -9
- data/ext/libxml/ruby_xml_encoding.c +250 -260
- data/ext/libxml/ruby_xml_encoding.h +16 -19
- data/ext/libxml/ruby_xml_error.c +996 -996
- data/ext/libxml/ruby_xml_error.h +12 -12
- data/ext/libxml/ruby_xml_html_parser.c +89 -92
- data/ext/libxml/ruby_xml_html_parser.h +10 -10
- data/ext/libxml/ruby_xml_html_parser_context.c +337 -338
- data/ext/libxml/ruby_xml_html_parser_context.h +10 -10
- data/ext/libxml/ruby_xml_html_parser_options.c +46 -46
- data/ext/libxml/ruby_xml_html_parser_options.h +10 -10
- data/ext/libxml/ruby_xml_input_cbg.c +191 -191
- data/ext/libxml/ruby_xml_input_cbg.h +20 -20
- data/ext/libxml/ruby_xml_io.c +47 -50
- data/ext/libxml/ruby_xml_io.h +10 -10
- data/ext/libxml/ruby_xml_namespace.c +153 -153
- data/ext/libxml/ruby_xml_namespace.h +10 -10
- data/ext/libxml/ruby_xml_namespaces.c +293 -293
- data/ext/libxml/ruby_xml_namespaces.h +9 -9
- data/ext/libxml/ruby_xml_node.c +1402 -1452
- data/ext/libxml/ruby_xml_node.h +13 -11
- data/ext/libxml/ruby_xml_parser.c +91 -94
- data/ext/libxml/ruby_xml_parser.h +12 -12
- data/ext/libxml/ruby_xml_parser_context.c +999 -1001
- data/ext/libxml/ruby_xml_parser_context.h +10 -10
- data/ext/libxml/ruby_xml_parser_options.c +66 -66
- data/ext/libxml/ruby_xml_parser_options.h +12 -12
- data/ext/libxml/ruby_xml_reader.c +1239 -1228
- data/ext/libxml/ruby_xml_reader.h +17 -17
- data/ext/libxml/ruby_xml_relaxng.c +110 -111
- data/ext/libxml/ruby_xml_relaxng.h +10 -10
- data/ext/libxml/ruby_xml_sax2_handler.c +326 -328
- data/ext/libxml/ruby_xml_sax2_handler.h +10 -10
- data/ext/libxml/ruby_xml_sax_parser.c +116 -120
- data/ext/libxml/ruby_xml_sax_parser.h +10 -10
- data/ext/libxml/ruby_xml_schema.c +278 -301
- data/ext/libxml/ruby_xml_schema.h +809 -809
- data/ext/libxml/ruby_xml_schema_attribute.c +109 -109
- data/ext/libxml/ruby_xml_schema_attribute.h +15 -15
- data/ext/libxml/ruby_xml_schema_element.c +95 -94
- data/ext/libxml/ruby_xml_schema_element.h +14 -14
- data/ext/libxml/ruby_xml_schema_facet.c +52 -52
- data/ext/libxml/ruby_xml_schema_facet.h +13 -13
- data/ext/libxml/ruby_xml_schema_type.c +232 -259
- data/ext/libxml/ruby_xml_schema_type.h +9 -9
- data/ext/libxml/ruby_xml_version.h +9 -9
- data/ext/libxml/ruby_xml_writer.c +1133 -1137
- data/ext/libxml/ruby_xml_writer.h +10 -10
- data/ext/libxml/ruby_xml_xinclude.c +16 -16
- data/ext/libxml/ruby_xml_xinclude.h +11 -11
- data/ext/libxml/ruby_xml_xpath.c +194 -188
- data/ext/libxml/ruby_xml_xpath.h +13 -13
- data/ext/libxml/ruby_xml_xpath_context.c +360 -361
- data/ext/libxml/ruby_xml_xpath_context.h +9 -9
- data/ext/libxml/ruby_xml_xpath_expression.c +81 -81
- data/ext/libxml/ruby_xml_xpath_expression.h +10 -10
- data/ext/libxml/ruby_xml_xpath_object.c +338 -335
- data/ext/libxml/ruby_xml_xpath_object.h +17 -17
- data/ext/libxml/ruby_xml_xpointer.c +99 -99
- data/ext/libxml/ruby_xml_xpointer.h +11 -11
- data/ext/vc/libxml_ruby.sln +17 -15
- data/lib/libxml-ruby.rb +30 -0
- data/lib/libxml.rb +3 -33
- data/lib/libxml/node.rb +2 -78
- data/lib/libxml/parser.rb +0 -266
- data/lib/libxml/sax_parser.rb +0 -17
- data/lib/libxml/schema.rb +47 -66
- data/lib/libxml/schema/attribute.rb +19 -19
- data/lib/libxml/schema/element.rb +19 -27
- data/lib/libxml/schema/type.rb +21 -29
- data/libxml-ruby.gemspec +48 -44
- data/script/benchmark/depixelate +634 -634
- data/script/benchmark/hamlet.xml +9054 -9054
- data/script/benchmark/parsecount +170 -170
- data/script/benchmark/throughput +41 -41
- data/script/test +6 -6
- data/setup.rb +0 -1
- data/test/c14n/given/example-1.xml +14 -14
- data/test/c14n/given/example-2.xml +11 -11
- data/test/c14n/given/example-3.xml +18 -18
- data/test/c14n/given/example-4.xml +9 -9
- data/test/c14n/given/example-5.xml +12 -12
- data/test/c14n/given/example-6.xml +2 -2
- data/test/c14n/given/example-7.xml +11 -11
- data/test/c14n/given/example-8.xml +11 -11
- data/test/c14n/given/example-8.xpath +9 -9
- data/test/c14n/result/1-1-without-comments/example-1 +3 -3
- data/test/c14n/result/1-1-without-comments/example-2 +10 -10
- data/test/c14n/result/1-1-without-comments/example-3 +13 -13
- data/test/c14n/result/1-1-without-comments/example-4 +8 -8
- data/test/c14n/result/1-1-without-comments/example-5 +2 -2
- data/test/c14n/result/with-comments/example-1 +5 -5
- data/test/c14n/result/with-comments/example-2 +10 -10
- data/test/c14n/result/with-comments/example-3 +13 -13
- data/test/c14n/result/with-comments/example-4 +8 -8
- data/test/c14n/result/with-comments/example-5 +3 -3
- data/test/c14n/result/without-comments/example-1 +3 -3
- data/test/c14n/result/without-comments/example-2 +10 -10
- data/test/c14n/result/without-comments/example-3 +13 -13
- data/test/c14n/result/without-comments/example-4 +8 -8
- data/test/c14n/result/without-comments/example-5 +2 -2
- data/test/model/atom.xml +12 -12
- data/test/model/bands.iso-8859-1.xml +4 -4
- data/test/model/bands.utf-8.xml +4 -4
- data/test/model/bands.xml +4 -4
- data/test/model/books.xml +153 -153
- data/test/model/cwm_1_0.xml +11336 -0
- data/test/model/merge_bug_data.xml +58 -58
- data/test/model/ruby-lang.html +238 -238
- data/test/model/rubynet.xml +79 -79
- data/test/model/shiporder.rnc +28 -28
- data/test/model/shiporder.rng +86 -86
- data/test/model/shiporder.xml +22 -22
- data/test/model/shiporder.xsd +39 -39
- data/test/model/soap.xml +27 -27
- data/test/model/xinclude.xml +4 -4
- data/test/test.xml +2 -0
- data/test/{tc_attr.rb → test_attr.rb} +23 -25
- data/test/{tc_attr_decl.rb → test_attr_decl.rb} +13 -14
- data/test/{tc_attributes.rb → test_attributes.rb} +11 -18
- data/test/{tc_canonicalize.rb → test_canonicalize.rb} +36 -41
- data/test/test_deprecated_require.rb +12 -0
- data/test/{tc_document.rb → test_document.rb} +32 -27
- data/test/test_document_write.rb +146 -0
- data/test/{tc_dtd.rb → test_dtd.rb} +28 -29
- data/test/{tc_encoding.rb → test_encoding.rb} +129 -126
- data/test/{tc_encoding_sax.rb → test_encoding_sax.rb} +7 -6
- data/test/test_error.rb +178 -0
- data/test/test_helper.rb +3 -10
- data/test/test_html_parser.rb +162 -0
- data/test/test_html_parser_context.rb +23 -0
- data/test/test_namespace.rb +60 -0
- data/test/{tc_namespaces.rb → test_namespaces.rb} +34 -44
- data/test/{tc_node.rb → test_node.rb} +68 -47
- data/test/{tc_node_cdata.rb → test_node_cdata.rb} +12 -13
- data/test/{tc_node_comment.rb → test_node_comment.rb} +7 -8
- data/test/{tc_node_copy.rb → test_node_copy.rb} +4 -6
- data/test/{tc_node_edit.rb → test_node_edit.rb} +23 -41
- data/test/{tc_node_pi.rb → test_node_pi.rb} +37 -40
- data/test/{tc_node_text.rb → test_node_text.rb} +10 -12
- data/test/{tc_node_write.rb → test_node_write.rb} +18 -29
- data/test/test_node_xlink.rb +28 -0
- data/test/test_parser.rb +324 -0
- data/test/{tc_parser_context.rb → test_parser_context.rb} +41 -42
- data/test/{tc_properties.rb → test_properties.rb} +6 -7
- data/test/test_reader.rb +363 -0
- data/test/test_relaxng.rb +53 -0
- data/test/{tc_sax_parser.rb → test_sax_parser.rb} +36 -37
- data/test/{tc_schema.rb → test_schema.rb} +43 -37
- data/test/test_suite.rb +38 -40
- data/test/{tc_traversal.rb → test_traversal.rb} +5 -6
- data/test/{tc_writer.rb → test_writer.rb} +468 -448
- data/test/{tc_xinclude.rb → test_xinclude.rb} +4 -5
- data/test/test_xml.rb +262 -0
- data/test/{tc_xpath.rb → test_xpath.rb} +31 -32
- data/test/{tc_xpath_context.rb → test_xpath_context.rb} +8 -9
- data/test/test_xpath_expression.rb +37 -0
- data/test/{tc_xpointer.rb → test_xpointer.rb} +16 -18
- metadata +117 -95
- data/lib/libxml/ns.rb +0 -22
- data/lib/libxml/properties.rb +0 -23
- data/lib/libxml/reader.rb +0 -29
- data/lib/libxml/xpath_object.rb +0 -16
- data/test/etc_doc_to_s.rb +0 -21
- data/test/ets_doc_file.rb +0 -17
- data/test/ets_doc_to_s.rb +0 -23
- data/test/ets_gpx.rb +0 -28
- data/test/ets_node_gc.rb +0 -23
- data/test/ets_test.xml +0 -2
- data/test/ets_tsr.rb +0 -11
- data/test/tc_deprecated_require.rb +0 -13
- data/test/tc_document_write.rb +0 -196
- data/test/tc_error.rb +0 -180
- data/test/tc_html_parser.rb +0 -153
- data/test/tc_html_parser_context.rb +0 -24
- data/test/tc_namespace.rb +0 -62
- data/test/tc_node_xlink.rb +0 -29
- data/test/tc_parser.rb +0 -381
- data/test/tc_reader.rb +0 -400
- data/test/tc_relaxng.rb +0 -54
- data/test/tc_xml.rb +0 -226
- data/test/tc_xpath_expression.rb +0 -38
@@ -1,809 +1,809 @@
|
|
1
|
-
#ifndef __RXML_SCHEMA__
|
2
|
-
#define __RXML_SCHEMA__
|
3
|
-
|
4
|
-
#include <libxml/schemasInternals.h>
|
5
|
-
#include <libxml/xmlschemas.h>
|
6
|
-
#include <libxml/xmlschemastypes.h>
|
7
|
-
|
8
|
-
extern VALUE cXMLSchema;
|
9
|
-
|
10
|
-
void rxml_init_schema(void);
|
11
|
-
|
12
|
-
#define QNIL_OR_STRING(slot) \
|
13
|
-
if (slot == NULL) \
|
14
|
-
return Qnil; \
|
15
|
-
else \
|
16
|
-
return rb_str_new2((const char *)slot);
|
17
|
-
|
18
|
-
#define SUBSET_RESTRICTION 1<<0
|
19
|
-
#define SUBSET_EXTENSION 1<<1
|
20
|
-
#define SUBSET_SUBSTITUTION 1<<2
|
21
|
-
#define SUBSET_LIST 1<<3
|
22
|
-
#define SUBSET_UNION 1<<4
|
23
|
-
|
24
|
-
typedef struct _xmlSchemaNodeInfo xmlSchemaNodeInfo;
|
25
|
-
typedef xmlSchemaNodeInfo *xmlSchemaNodeInfoPtr;
|
26
|
-
|
27
|
-
typedef struct _xmlSchemaItemList xmlSchemaItemList;
|
28
|
-
typedef xmlSchemaItemList *xmlSchemaItemListPtr;
|
29
|
-
struct _xmlSchemaItemList {
|
30
|
-
void **items;
|
31
|
-
/* used for dynamic addition of schemata */
|
32
|
-
int nbItems;
|
33
|
-
/* used for dynamic addition of schemata */
|
34
|
-
int sizeItems; /* used for dynamic addition of schemata */
|
35
|
-
};
|
36
|
-
|
37
|
-
#define XML_SCHEMA_CTXT_PARSER 1
|
38
|
-
#define XML_SCHEMA_CTXT_VALIDATOR 2
|
39
|
-
|
40
|
-
typedef struct _xmlSchemaAbstractCtxt xmlSchemaAbstractCtxt;
|
41
|
-
typedef xmlSchemaAbstractCtxt *xmlSchemaAbstractCtxtPtr;
|
42
|
-
struct _xmlSchemaAbstractCtxt {
|
43
|
-
int type; /* E.g. XML_SCHEMA_CTXT_VALIDATOR */
|
44
|
-
};
|
45
|
-
|
46
|
-
typedef struct _xmlSchemaBucket xmlSchemaBucket;
|
47
|
-
typedef xmlSchemaBucket *xmlSchemaBucketPtr;
|
48
|
-
|
49
|
-
#define XML_SCHEMA_SCHEMA_MAIN 0
|
50
|
-
#define XML_SCHEMA_SCHEMA_IMPORT 1
|
51
|
-
#define XML_SCHEMA_SCHEMA_INCLUDE 2
|
52
|
-
#define XML_SCHEMA_SCHEMA_REDEFINE 3
|
53
|
-
|
54
|
-
/**
|
55
|
-
* xmlSchemaSchemaRelation:
|
56
|
-
*
|
57
|
-
* Used to create a graph of schema relationships.
|
58
|
-
*/
|
59
|
-
typedef struct _xmlSchemaSchemaRelation xmlSchemaSchemaRelation;
|
60
|
-
typedef xmlSchemaSchemaRelation *xmlSchemaSchemaRelationPtr;
|
61
|
-
struct _xmlSchemaSchemaRelation {
|
62
|
-
xmlSchemaSchemaRelationPtr next;
|
63
|
-
int type;
|
64
|
-
/* E.g. XML_SCHEMA_SCHEMA_IMPORT */
|
65
|
-
const xmlChar *importNamespace;
|
66
|
-
xmlSchemaBucketPtr bucket;
|
67
|
-
};
|
68
|
-
|
69
|
-
#define XML_SCHEMA_BUCKET_MARKED 1<<0
|
70
|
-
#define XML_SCHEMA_BUCKET_COMPS_ADDED 1<<1
|
71
|
-
|
72
|
-
struct _xmlSchemaBucket {
|
73
|
-
int type;
|
74
|
-
int flags;
|
75
|
-
const xmlChar *schemaLocation;
|
76
|
-
const xmlChar *origTargetNamespace;
|
77
|
-
const xmlChar *targetNamespace;
|
78
|
-
xmlDocPtr doc;
|
79
|
-
xmlSchemaSchemaRelationPtr relations;
|
80
|
-
int located;
|
81
|
-
int parsed;
|
82
|
-
int imported;
|
83
|
-
int preserveDoc;
|
84
|
-
xmlSchemaItemListPtr globals;
|
85
|
-
/* Global components. */
|
86
|
-
xmlSchemaItemListPtr locals; /* Local components. */
|
87
|
-
};
|
88
|
-
|
89
|
-
/**
|
90
|
-
* xmlSchemaImport:
|
91
|
-
* (extends xmlSchemaBucket)
|
92
|
-
*
|
93
|
-
* Reflects a schema. Holds some information
|
94
|
-
* about the schema and its toplevel components. Duplicate
|
95
|
-
* toplevel components are not checked at this level.
|
96
|
-
*/
|
97
|
-
typedef struct _xmlSchemaImport xmlSchemaImport;
|
98
|
-
typedef xmlSchemaImport *xmlSchemaImportPtr;
|
99
|
-
struct _xmlSchemaImport {
|
100
|
-
int type;
|
101
|
-
/* Main OR import OR include. */
|
102
|
-
int flags;
|
103
|
-
const xmlChar *schemaLocation; /* The URI of the schema document. */
|
104
|
-
/* For chameleon includes, @origTargetNamespace will be NULL */
|
105
|
-
const xmlChar *origTargetNamespace;
|
106
|
-
/*
|
107
|
-
* For chameleon includes, @targetNamespace will be the
|
108
|
-
* targetNamespace of the including schema.
|
109
|
-
*/
|
110
|
-
const xmlChar *targetNamespace;
|
111
|
-
xmlDocPtr doc; /* The schema node-tree. */
|
112
|
-
/* @relations will hold any included/imported/redefined schemas. */
|
113
|
-
xmlSchemaSchemaRelationPtr relations;
|
114
|
-
int located;
|
115
|
-
int parsed;
|
116
|
-
int imported;
|
117
|
-
int preserveDoc;
|
118
|
-
xmlSchemaItemListPtr globals;
|
119
|
-
xmlSchemaItemListPtr locals;
|
120
|
-
/* The imported schema. */
|
121
|
-
xmlSchemaPtr schema;
|
122
|
-
};
|
123
|
-
|
124
|
-
/*
|
125
|
-
* (extends xmlSchemaBucket)
|
126
|
-
*/
|
127
|
-
typedef struct _xmlSchemaInclude xmlSchemaInclude;
|
128
|
-
typedef xmlSchemaInclude *xmlSchemaIncludePtr;
|
129
|
-
struct _xmlSchemaInclude {
|
130
|
-
int type;
|
131
|
-
int flags;
|
132
|
-
const xmlChar *schemaLocation;
|
133
|
-
const xmlChar *origTargetNamespace;
|
134
|
-
const xmlChar *targetNamespace;
|
135
|
-
xmlDocPtr doc;
|
136
|
-
xmlSchemaSchemaRelationPtr relations;
|
137
|
-
int located;
|
138
|
-
int parsed;
|
139
|
-
int imported;
|
140
|
-
int preserveDoc;
|
141
|
-
xmlSchemaItemListPtr globals;
|
142
|
-
/* Global components. */
|
143
|
-
xmlSchemaItemListPtr locals; /* Local components. */
|
144
|
-
|
145
|
-
/* The owning main or import schema bucket. */
|
146
|
-
xmlSchemaImportPtr ownerImport;
|
147
|
-
};
|
148
|
-
|
149
|
-
/**
|
150
|
-
* xmlSchemaBasicItem:
|
151
|
-
*
|
152
|
-
* The abstract base type for schema components.
|
153
|
-
*/
|
154
|
-
typedef struct _xmlSchemaBasicItem xmlSchemaBasicItem;
|
155
|
-
typedef xmlSchemaBasicItem *xmlSchemaBasicItemPtr;
|
156
|
-
struct _xmlSchemaBasicItem {
|
157
|
-
xmlSchemaTypeType type;
|
158
|
-
};
|
159
|
-
|
160
|
-
/**
|
161
|
-
* xmlSchemaAnnotItem:
|
162
|
-
*
|
163
|
-
* The abstract base type for annotated schema components.
|
164
|
-
* (Extends xmlSchemaBasicItem)
|
165
|
-
*/
|
166
|
-
typedef struct _xmlSchemaAnnotItem xmlSchemaAnnotItem;
|
167
|
-
typedef xmlSchemaAnnotItem *xmlSchemaAnnotItemPtr;
|
168
|
-
struct _xmlSchemaAnnotItem {
|
169
|
-
xmlSchemaTypeType type;
|
170
|
-
xmlSchemaAnnotPtr annot;
|
171
|
-
};
|
172
|
-
|
173
|
-
/**
|
174
|
-
* xmlSchemaTreeItem:
|
175
|
-
*
|
176
|
-
* The abstract base type for tree-like structured schema components.
|
177
|
-
* (Extends xmlSchemaAnnotItem)
|
178
|
-
*/
|
179
|
-
typedef struct _xmlSchemaTreeItem xmlSchemaTreeItem;
|
180
|
-
typedef xmlSchemaTreeItem *xmlSchemaTreeItemPtr;
|
181
|
-
struct _xmlSchemaTreeItem {
|
182
|
-
xmlSchemaTypeType type;
|
183
|
-
xmlSchemaAnnotPtr annot;
|
184
|
-
xmlSchemaTreeItemPtr next;
|
185
|
-
xmlSchemaTreeItemPtr children;
|
186
|
-
};
|
187
|
-
|
188
|
-
|
189
|
-
#define XML_SCHEMA_ATTR_USE_FIXED 1<<0
|
190
|
-
/**
|
191
|
-
* xmlSchemaAttributeUsePtr:
|
192
|
-
*
|
193
|
-
* The abstract base type for tree-like structured schema components.
|
194
|
-
* (Extends xmlSchemaTreeItem)
|
195
|
-
*/
|
196
|
-
typedef struct _xmlSchemaAttributeUse xmlSchemaAttributeUse;
|
197
|
-
typedef xmlSchemaAttributeUse *xmlSchemaAttributeUsePtr;
|
198
|
-
struct _xmlSchemaAttributeUse {
|
199
|
-
xmlSchemaTypeType type;
|
200
|
-
xmlSchemaAnnotPtr annot;
|
201
|
-
xmlSchemaAttributeUsePtr next; /* The next attr. use. */
|
202
|
-
/*
|
203
|
-
* The attr. decl. OR a QName-ref. to an attr. decl. OR
|
204
|
-
* a QName-ref. to an attribute group definition.
|
205
|
-
*/
|
206
|
-
xmlSchemaAttributePtr attrDecl;
|
207
|
-
|
208
|
-
int flags;
|
209
|
-
xmlNodePtr node;
|
210
|
-
int occurs;
|
211
|
-
/* required, optional */
|
212
|
-
const xmlChar *defValue;
|
213
|
-
xmlSchemaValPtr defVal;
|
214
|
-
};
|
215
|
-
|
216
|
-
/**
|
217
|
-
* xmlSchemaAttributeUseProhibPtr:
|
218
|
-
*
|
219
|
-
* A helper component to reflect attribute prohibitions.
|
220
|
-
* (Extends xmlSchemaBasicItem)
|
221
|
-
*/
|
222
|
-
typedef struct _xmlSchemaAttributeUseProhib xmlSchemaAttributeUseProhib;
|
223
|
-
typedef xmlSchemaAttributeUseProhib *xmlSchemaAttributeUseProhibPtr;
|
224
|
-
struct _xmlSchemaAttributeUseProhib {
|
225
|
-
xmlSchemaTypeType type;
|
226
|
-
/* == XML_SCHEMA_EXTRA_ATTR_USE_PROHIB */
|
227
|
-
xmlNodePtr node;
|
228
|
-
const xmlChar *name;
|
229
|
-
const xmlChar *targetNamespace;
|
230
|
-
int isRef;
|
231
|
-
};
|
232
|
-
|
233
|
-
/**
|
234
|
-
* xmlSchemaRedef:
|
235
|
-
*/
|
236
|
-
typedef struct _xmlSchemaRedef xmlSchemaRedef;
|
237
|
-
typedef xmlSchemaRedef *xmlSchemaRedefPtr;
|
238
|
-
struct _xmlSchemaRedef {
|
239
|
-
xmlSchemaRedefPtr next;
|
240
|
-
xmlSchemaBasicItemPtr item;
|
241
|
-
/* The redefining component. */
|
242
|
-
xmlSchemaBasicItemPtr reference;
|
243
|
-
/* The referencing component. */
|
244
|
-
xmlSchemaBasicItemPtr target;
|
245
|
-
/* The to-be-redefined component. */
|
246
|
-
const xmlChar *refName;
|
247
|
-
/* The name of the to-be-redefined component. */
|
248
|
-
const xmlChar *refTargetNs;
|
249
|
-
/* The target namespace of the
|
250
|
-
to-be-redefined comp. */
|
251
|
-
xmlSchemaBucketPtr targetBucket; /* The redefined schema. */
|
252
|
-
};
|
253
|
-
|
254
|
-
/**
|
255
|
-
* xmlSchemaConstructionCtxt:
|
256
|
-
*/
|
257
|
-
typedef struct _xmlSchemaConstructionCtxt xmlSchemaConstructionCtxt;
|
258
|
-
typedef xmlSchemaConstructionCtxt *xmlSchemaConstructionCtxtPtr;
|
259
|
-
struct _xmlSchemaConstructionCtxt {
|
260
|
-
xmlSchemaPtr mainSchema;
|
261
|
-
/* The main schema. */
|
262
|
-
xmlSchemaBucketPtr mainBucket;
|
263
|
-
/* The main schema bucket */
|
264
|
-
xmlDictPtr dict;
|
265
|
-
xmlSchemaItemListPtr buckets; /* List of schema buckets. */
|
266
|
-
/* xmlSchemaItemListPtr relations; */ /* List of schema relations. */
|
267
|
-
xmlSchemaBucketPtr bucket;
|
268
|
-
/* The current schema bucket */
|
269
|
-
xmlSchemaItemListPtr pending;
|
270
|
-
/* All Components of all schemas that
|
271
|
-
need to be fixed. */
|
272
|
-
xmlHashTablePtr substGroups;
|
273
|
-
xmlSchemaRedefPtr redefs;
|
274
|
-
xmlSchemaRedefPtr lastRedef;
|
275
|
-
};
|
276
|
-
|
277
|
-
#define XML_SCHEMAS_PARSE_ERROR 1
|
278
|
-
#define SCHEMAS_PARSE_OPTIONS XML_PARSE_NOENT
|
279
|
-
|
280
|
-
struct _xmlSchemaParserCtxt {
|
281
|
-
int type;
|
282
|
-
void *errCtxt;
|
283
|
-
/* user specific error context */
|
284
|
-
xmlSchemaValidityErrorFunc error;
|
285
|
-
/* the callback in case of errors */
|
286
|
-
xmlSchemaValidityWarningFunc warning;
|
287
|
-
/* the callback in case of warning */
|
288
|
-
int err;
|
289
|
-
int nberrors;
|
290
|
-
xmlStructuredErrorFunc serror;
|
291
|
-
|
292
|
-
xmlSchemaConstructionCtxtPtr constructor;
|
293
|
-
int ownsConstructor; /* TODO: Move this to parser *flags*. */
|
294
|
-
|
295
|
-
/* xmlSchemaPtr topschema; */
|
296
|
-
/* xmlHashTablePtr namespaces; */
|
297
|
-
|
298
|
-
xmlSchemaPtr schema;
|
299
|
-
/* The main schema in use */
|
300
|
-
int counter;
|
301
|
-
|
302
|
-
const xmlChar *URL;
|
303
|
-
xmlDocPtr doc;
|
304
|
-
int preserve;
|
305
|
-
/* Whether the doc should be freed */
|
306
|
-
|
307
|
-
const char *buffer;
|
308
|
-
int size;
|
309
|
-
|
310
|
-
/*
|
311
|
-
* Used to build complex element content models
|
312
|
-
*/
|
313
|
-
xmlAutomataPtr am;
|
314
|
-
xmlAutomataStatePtr start;
|
315
|
-
xmlAutomataStatePtr end;
|
316
|
-
xmlAutomataStatePtr state;
|
317
|
-
|
318
|
-
xmlDictPtr dict;
|
319
|
-
/* dictionnary for interned string names */
|
320
|
-
xmlSchemaTypePtr ctxtType;
|
321
|
-
/* The current context simple/complex type */
|
322
|
-
int options;
|
323
|
-
xmlSchemaValidCtxtPtr vctxt;
|
324
|
-
int isS4S;
|
325
|
-
int isRedefine;
|
326
|
-
int xsiAssemble;
|
327
|
-
int stop;
|
328
|
-
/* If the parser should stop; i.e. a critical error. */
|
329
|
-
const xmlChar *targetNamespace;
|
330
|
-
xmlSchemaBucketPtr redefined;
|
331
|
-
/* The schema to be redefined. */
|
332
|
-
|
333
|
-
xmlSchemaRedefPtr redef;
|
334
|
-
/* Used for redefinitions. */
|
335
|
-
int redefCounter;
|
336
|
-
/* Used for redefinitions. */
|
337
|
-
xmlSchemaItemListPtr attrProhibs;
|
338
|
-
};
|
339
|
-
|
340
|
-
/**
|
341
|
-
* xmlSchemaQNameRef:
|
342
|
-
*
|
343
|
-
* A component reference item (not a schema component)
|
344
|
-
* (Extends xmlSchemaBasicItem)
|
345
|
-
*/
|
346
|
-
typedef struct _xmlSchemaQNameRef xmlSchemaQNameRef;
|
347
|
-
typedef xmlSchemaQNameRef *xmlSchemaQNameRefPtr;
|
348
|
-
struct _xmlSchemaQNameRef {
|
349
|
-
xmlSchemaTypeType type;
|
350
|
-
xmlSchemaBasicItemPtr item;
|
351
|
-
/* The resolved referenced item. */
|
352
|
-
xmlSchemaTypeType itemType;
|
353
|
-
const xmlChar *name;
|
354
|
-
const xmlChar *targetNamespace;
|
355
|
-
xmlNodePtr node;
|
356
|
-
};
|
357
|
-
|
358
|
-
/**
|
359
|
-
* xmlSchemaParticle:
|
360
|
-
*
|
361
|
-
* A particle component.
|
362
|
-
* (Extends xmlSchemaTreeItem)
|
363
|
-
*/
|
364
|
-
typedef struct _xmlSchemaParticle xmlSchemaParticle;
|
365
|
-
typedef xmlSchemaParticle *xmlSchemaParticlePtr;
|
366
|
-
struct _xmlSchemaParticle {
|
367
|
-
xmlSchemaTypeType type;
|
368
|
-
xmlSchemaAnnotPtr annot;
|
369
|
-
xmlSchemaTreeItemPtr next;
|
370
|
-
/* next particle */
|
371
|
-
xmlSchemaTreeItemPtr children;
|
372
|
-
/* the "term" (e.g. a model group,
|
373
|
-
a group definition, a XML_SCHEMA_EXTRA_QNAMEREF (if a reference),
|
374
|
-
etc.) */
|
375
|
-
int minOccurs;
|
376
|
-
int maxOccurs;
|
377
|
-
xmlNodePtr node;
|
378
|
-
};
|
379
|
-
|
380
|
-
/**
|
381
|
-
* xmlSchemaModelGroup:
|
382
|
-
*
|
383
|
-
* A model group component.
|
384
|
-
* (Extends xmlSchemaTreeItem)
|
385
|
-
*/
|
386
|
-
typedef struct _xmlSchemaModelGroup xmlSchemaModelGroup;
|
387
|
-
typedef xmlSchemaModelGroup *xmlSchemaModelGroupPtr;
|
388
|
-
struct _xmlSchemaModelGroup {
|
389
|
-
xmlSchemaTypeType type;
|
390
|
-
/* XML_SCHEMA_TYPE_SEQUENCE, XML_SCHEMA_TYPE_CHOICE, XML_SCHEMA_TYPE_ALL */
|
391
|
-
xmlSchemaAnnotPtr annot;
|
392
|
-
xmlSchemaTreeItemPtr next;
|
393
|
-
/* not used */
|
394
|
-
xmlSchemaTreeItemPtr children;
|
395
|
-
/* first particle (OR "element decl" OR "wildcard") */
|
396
|
-
xmlNodePtr node;
|
397
|
-
};
|
398
|
-
|
399
|
-
#define XML_SCHEMA_MODEL_GROUP_DEF_MARKED 1<<0
|
400
|
-
#define XML_SCHEMA_MODEL_GROUP_DEF_REDEFINED 1<<1
|
401
|
-
/**
|
402
|
-
* xmlSchemaModelGroupDef:
|
403
|
-
*
|
404
|
-
* A model group definition component.
|
405
|
-
* (Extends xmlSchemaTreeItem)
|
406
|
-
*/
|
407
|
-
typedef struct _xmlSchemaModelGroupDef xmlSchemaModelGroupDef;
|
408
|
-
typedef xmlSchemaModelGroupDef *xmlSchemaModelGroupDefPtr;
|
409
|
-
struct _xmlSchemaModelGroupDef {
|
410
|
-
xmlSchemaTypeType type;
|
411
|
-
/* XML_SCHEMA_TYPE_GROUP */
|
412
|
-
xmlSchemaAnnotPtr annot;
|
413
|
-
xmlSchemaTreeItemPtr next;
|
414
|
-
/* not used */
|
415
|
-
xmlSchemaTreeItemPtr children;
|
416
|
-
/* the "model group" */
|
417
|
-
const xmlChar *name;
|
418
|
-
const xmlChar *targetNamespace;
|
419
|
-
xmlNodePtr node;
|
420
|
-
int flags;
|
421
|
-
};
|
422
|
-
|
423
|
-
typedef struct _xmlSchemaIDC xmlSchemaIDC;
|
424
|
-
typedef xmlSchemaIDC *xmlSchemaIDCPtr;
|
425
|
-
|
426
|
-
/**
|
427
|
-
* xmlSchemaIDCSelect:
|
428
|
-
*
|
429
|
-
* The identity-constraint "field" and "selector" item, holding the
|
430
|
-
* XPath expression.
|
431
|
-
*/
|
432
|
-
typedef struct _xmlSchemaIDCSelect xmlSchemaIDCSelect;
|
433
|
-
typedef xmlSchemaIDCSelect *xmlSchemaIDCSelectPtr;
|
434
|
-
struct _xmlSchemaIDCSelect {
|
435
|
-
xmlSchemaIDCSelectPtr next;
|
436
|
-
xmlSchemaIDCPtr idc;
|
437
|
-
int index;
|
438
|
-
/* an index position if significant for IDC key-sequences */
|
439
|
-
const xmlChar *xpath;
|
440
|
-
/* the XPath expression */
|
441
|
-
void *xpathComp; /* the compiled XPath expression */
|
442
|
-
};
|
443
|
-
|
444
|
-
/**
|
445
|
-
* xmlSchemaIDC:
|
446
|
-
*
|
447
|
-
* The identity-constraint definition component.
|
448
|
-
* (Extends xmlSchemaAnnotItem)
|
449
|
-
*/
|
450
|
-
|
451
|
-
struct _xmlSchemaIDC {
|
452
|
-
xmlSchemaTypeType type;
|
453
|
-
xmlSchemaAnnotPtr annot;
|
454
|
-
xmlSchemaIDCPtr next;
|
455
|
-
xmlNodePtr node;
|
456
|
-
const xmlChar *name;
|
457
|
-
const xmlChar *targetNamespace;
|
458
|
-
xmlSchemaIDCSelectPtr selector;
|
459
|
-
xmlSchemaIDCSelectPtr fields;
|
460
|
-
int nbFields;
|
461
|
-
xmlSchemaQNameRefPtr ref;
|
462
|
-
};
|
463
|
-
|
464
|
-
/**
|
465
|
-
* xmlSchemaIDCAug:
|
466
|
-
*
|
467
|
-
* The augmented IDC information used for validation.
|
468
|
-
*/
|
469
|
-
typedef struct _xmlSchemaIDCAug xmlSchemaIDCAug;
|
470
|
-
typedef xmlSchemaIDCAug *xmlSchemaIDCAugPtr;
|
471
|
-
struct _xmlSchemaIDCAug {
|
472
|
-
xmlSchemaIDCAugPtr next;
|
473
|
-
/* next in a list */
|
474
|
-
xmlSchemaIDCPtr def;
|
475
|
-
/* the IDC definition */
|
476
|
-
int keyrefDepth; /* the lowest tree level to which IDC
|
477
|
-
tables need to be bubbled upwards */
|
478
|
-
};
|
479
|
-
|
480
|
-
/**
|
481
|
-
* xmlSchemaPSVIIDCKeySequence:
|
482
|
-
*
|
483
|
-
* The key sequence of a node table item.
|
484
|
-
*/
|
485
|
-
typedef struct _xmlSchemaPSVIIDCKey xmlSchemaPSVIIDCKey;
|
486
|
-
typedef xmlSchemaPSVIIDCKey *xmlSchemaPSVIIDCKeyPtr;
|
487
|
-
struct _xmlSchemaPSVIIDCKey {
|
488
|
-
xmlSchemaTypePtr type;
|
489
|
-
xmlSchemaValPtr val;
|
490
|
-
};
|
491
|
-
|
492
|
-
/**
|
493
|
-
* xmlSchemaPSVIIDCNode:
|
494
|
-
*
|
495
|
-
* The node table item of a node table.
|
496
|
-
*/
|
497
|
-
typedef struct _xmlSchemaPSVIIDCNode xmlSchemaPSVIIDCNode;
|
498
|
-
typedef xmlSchemaPSVIIDCNode *xmlSchemaPSVIIDCNodePtr;
|
499
|
-
struct _xmlSchemaPSVIIDCNode {
|
500
|
-
xmlNodePtr node;
|
501
|
-
xmlSchemaPSVIIDCKeyPtr *keys;
|
502
|
-
int nodeLine;
|
503
|
-
int nodeQNameID;
|
504
|
-
|
505
|
-
};
|
506
|
-
|
507
|
-
/**
|
508
|
-
* xmlSchemaPSVIIDCBinding:
|
509
|
-
*
|
510
|
-
* The identity-constraint binding item of the [identity-constraint table].
|
511
|
-
*/
|
512
|
-
typedef struct _xmlSchemaPSVIIDCBinding xmlSchemaPSVIIDCBinding;
|
513
|
-
typedef xmlSchemaPSVIIDCBinding *xmlSchemaPSVIIDCBindingPtr;
|
514
|
-
struct _xmlSchemaPSVIIDCBinding {
|
515
|
-
xmlSchemaPSVIIDCBindingPtr next;
|
516
|
-
/* next binding of a specific node */
|
517
|
-
xmlSchemaIDCPtr definition;
|
518
|
-
/* the IDC definition */
|
519
|
-
xmlSchemaPSVIIDCNodePtr *nodeTable;
|
520
|
-
/* array of key-sequences */
|
521
|
-
int nbNodes;
|
522
|
-
/* number of entries in the node table */
|
523
|
-
int sizeNodes;
|
524
|
-
/* size of the node table */
|
525
|
-
xmlSchemaItemListPtr dupls;
|
526
|
-
};
|
527
|
-
|
528
|
-
|
529
|
-
#define XPATH_STATE_OBJ_TYPE_IDC_SELECTOR 1
|
530
|
-
#define XPATH_STATE_OBJ_TYPE_IDC_FIELD 2
|
531
|
-
|
532
|
-
#define XPATH_STATE_OBJ_MATCHES -2
|
533
|
-
#define XPATH_STATE_OBJ_BLOCKED -3
|
534
|
-
|
535
|
-
typedef struct _xmlSchemaIDCMatcher xmlSchemaIDCMatcher;
|
536
|
-
typedef xmlSchemaIDCMatcher *xmlSchemaIDCMatcherPtr;
|
537
|
-
|
538
|
-
/**
|
539
|
-
* xmlSchemaIDCStateObj:
|
540
|
-
*
|
541
|
-
* The state object used to evaluate XPath expressions.
|
542
|
-
*/
|
543
|
-
typedef struct _xmlSchemaIDCStateObj xmlSchemaIDCStateObj;
|
544
|
-
typedef xmlSchemaIDCStateObj *xmlSchemaIDCStateObjPtr;
|
545
|
-
struct _xmlSchemaIDCStateObj {
|
546
|
-
int type;
|
547
|
-
xmlSchemaIDCStateObjPtr next;
|
548
|
-
/* next if in a list */
|
549
|
-
int depth;
|
550
|
-
/* depth of creation */
|
551
|
-
int *history;
|
552
|
-
/* list of (depth, state-id) tuples */
|
553
|
-
int nbHistory;
|
554
|
-
int sizeHistory;
|
555
|
-
xmlSchemaIDCMatcherPtr matcher;
|
556
|
-
/* the correspondent field/selector
|
557
|
-
matcher */
|
558
|
-
xmlSchemaIDCSelectPtr sel;
|
559
|
-
void *xpathCtxt;
|
560
|
-
};
|
561
|
-
|
562
|
-
#define IDC_MATCHER 0
|
563
|
-
|
564
|
-
/**
|
565
|
-
* xmlSchemaIDCMatcher:
|
566
|
-
*
|
567
|
-
* Used to evaluate IDC selectors (and fields).
|
568
|
-
*/
|
569
|
-
struct _xmlSchemaIDCMatcher {
|
570
|
-
int type;
|
571
|
-
int depth;
|
572
|
-
/* the tree depth at creation time */
|
573
|
-
xmlSchemaIDCMatcherPtr next;
|
574
|
-
/* next in the list */
|
575
|
-
xmlSchemaIDCMatcherPtr nextCached;
|
576
|
-
/* next in the cache list */
|
577
|
-
xmlSchemaIDCAugPtr aidc;
|
578
|
-
/* the augmented IDC item */
|
579
|
-
int idcType;
|
580
|
-
xmlSchemaPSVIIDCKeyPtr **keySeqs;
|
581
|
-
/* the key-sequences of the target
|
582
|
-
elements */
|
583
|
-
int sizeKeySeqs;
|
584
|
-
xmlSchemaItemListPtr targets; /* list of target-node
|
585
|
-
(xmlSchemaPSVIIDCNodePtr) entries */
|
586
|
-
};
|
587
|
-
|
588
|
-
/*
|
589
|
-
* Element info flags.
|
590
|
-
*/
|
591
|
-
#define XML_SCHEMA_NODE_INFO_FLAG_OWNED_NAMES 1<<0
|
592
|
-
#define XML_SCHEMA_NODE_INFO_FLAG_OWNED_VALUES 1<<1
|
593
|
-
#define XML_SCHEMA_ELEM_INFO_NILLED 1<<2
|
594
|
-
#define XML_SCHEMA_ELEM_INFO_LOCAL_TYPE 1<<3
|
595
|
-
|
596
|
-
#define XML_SCHEMA_NODE_INFO_VALUE_NEEDED 1<<4
|
597
|
-
#define XML_SCHEMA_ELEM_INFO_EMPTY 1<<5
|
598
|
-
#define XML_SCHEMA_ELEM_INFO_HAS_CONTENT 1<<6
|
599
|
-
|
600
|
-
#define XML_SCHEMA_ELEM_INFO_HAS_ELEM_CONTENT 1<<7
|
601
|
-
#define XML_SCHEMA_ELEM_INFO_ERR_BAD_CONTENT 1<<8
|
602
|
-
#define XML_SCHEMA_NODE_INFO_ERR_NOT_EXPECTED 1<<9
|
603
|
-
#define XML_SCHEMA_NODE_INFO_ERR_BAD_TYPE 1<<10
|
604
|
-
|
605
|
-
/**
|
606
|
-
* xmlSchemaNodeInfo:
|
607
|
-
*
|
608
|
-
* Holds information of an element node.
|
609
|
-
*/
|
610
|
-
struct _xmlSchemaNodeInfo {
|
611
|
-
int nodeType;
|
612
|
-
xmlNodePtr node;
|
613
|
-
int nodeLine;
|
614
|
-
const xmlChar *localName;
|
615
|
-
const xmlChar *nsName;
|
616
|
-
const xmlChar *value;
|
617
|
-
xmlSchemaValPtr val;
|
618
|
-
/* the pre-computed value if any */
|
619
|
-
xmlSchemaTypePtr typeDef;
|
620
|
-
/* the complex/simple type definition if any */
|
621
|
-
|
622
|
-
int flags;
|
623
|
-
/* combination of node info flags */
|
624
|
-
|
625
|
-
int valNeeded;
|
626
|
-
int normVal;
|
627
|
-
|
628
|
-
xmlSchemaElementPtr decl;
|
629
|
-
/* the element/attribute declaration */
|
630
|
-
int depth;
|
631
|
-
xmlSchemaPSVIIDCBindingPtr idcTable;
|
632
|
-
/* the table of PSVI IDC bindings
|
633
|
-
for the scope element*/
|
634
|
-
xmlSchemaIDCMatcherPtr idcMatchers;
|
635
|
-
/* the IDC matchers for the scope
|
636
|
-
element */
|
637
|
-
xmlRegExecCtxtPtr regexCtxt;
|
638
|
-
|
639
|
-
const xmlChar **nsBindings;
|
640
|
-
/* Namespace bindings on this element */
|
641
|
-
int nbNsBindings;
|
642
|
-
int sizeNsBindings;
|
643
|
-
|
644
|
-
int hasKeyrefs;
|
645
|
-
int appliedXPath; /* Indicates that an XPath has been applied. */
|
646
|
-
};
|
647
|
-
|
648
|
-
#define XML_SCHEMAS_ATTR_UNKNOWN 1
|
649
|
-
#define XML_SCHEMAS_ATTR_ASSESSED 2
|
650
|
-
#define XML_SCHEMAS_ATTR_PROHIBITED 3
|
651
|
-
#define XML_SCHEMAS_ATTR_ERR_MISSING 4
|
652
|
-
#define XML_SCHEMAS_ATTR_INVALID_VALUE 5
|
653
|
-
#define XML_SCHEMAS_ATTR_ERR_NO_TYPE 6
|
654
|
-
#define XML_SCHEMAS_ATTR_ERR_FIXED_VALUE 7
|
655
|
-
#define XML_SCHEMAS_ATTR_DEFAULT 8
|
656
|
-
#define XML_SCHEMAS_ATTR_VALIDATE_VALUE 9
|
657
|
-
#define XML_SCHEMAS_ATTR_ERR_WILD_STRICT_NO_DECL 10
|
658
|
-
#define XML_SCHEMAS_ATTR_HAS_ATTR_USE 11
|
659
|
-
#define XML_SCHEMAS_ATTR_HAS_ATTR_DECL 12
|
660
|
-
#define XML_SCHEMAS_ATTR_WILD_SKIP 13
|
661
|
-
#define XML_SCHEMAS_ATTR_WILD_LAX_NO_DECL 14
|
662
|
-
#define XML_SCHEMAS_ATTR_ERR_WILD_DUPLICATE_ID 15
|
663
|
-
#define XML_SCHEMAS_ATTR_ERR_WILD_AND_USE_ID 16
|
664
|
-
#define XML_SCHEMAS_ATTR_META 17
|
665
|
-
/*
|
666
|
-
* @metaType values of xmlSchemaAttrInfo.
|
667
|
-
*/
|
668
|
-
#define XML_SCHEMA_ATTR_INFO_META_XSI_TYPE 1
|
669
|
-
#define XML_SCHEMA_ATTR_INFO_META_XSI_NIL 2
|
670
|
-
#define XML_SCHEMA_ATTR_INFO_META_XSI_SCHEMA_LOC 3
|
671
|
-
#define XML_SCHEMA_ATTR_INFO_META_XSI_NO_NS_SCHEMA_LOC 4
|
672
|
-
#define XML_SCHEMA_ATTR_INFO_META_XMLNS 5
|
673
|
-
|
674
|
-
typedef struct _xmlSchemaAttrInfo xmlSchemaAttrInfo;
|
675
|
-
typedef xmlSchemaAttrInfo *xmlSchemaAttrInfoPtr;
|
676
|
-
struct _xmlSchemaAttrInfo {
|
677
|
-
int nodeType;
|
678
|
-
xmlNodePtr node;
|
679
|
-
int nodeLine;
|
680
|
-
const xmlChar *localName;
|
681
|
-
const xmlChar *nsName;
|
682
|
-
const xmlChar *value;
|
683
|
-
xmlSchemaValPtr val;
|
684
|
-
/* the pre-computed value if any */
|
685
|
-
xmlSchemaTypePtr typeDef;
|
686
|
-
/* the complex/simple type definition if any */
|
687
|
-
int flags;
|
688
|
-
/* combination of node info flags */
|
689
|
-
|
690
|
-
xmlSchemaAttributePtr decl;
|
691
|
-
/* the attribute declaration */
|
692
|
-
xmlSchemaAttributeUsePtr use;
|
693
|
-
/* the attribute use */
|
694
|
-
int state;
|
695
|
-
int metaType;
|
696
|
-
const xmlChar *vcValue;
|
697
|
-
/* the value constraint value */
|
698
|
-
xmlSchemaNodeInfoPtr parent;
|
699
|
-
};
|
700
|
-
|
701
|
-
|
702
|
-
#define XML_SCHEMA_VALID_CTXT_FLAG_STREAM 1
|
703
|
-
/**
|
704
|
-
* xmlSchemaValidCtxt:
|
705
|
-
*
|
706
|
-
* A Schemas validation context
|
707
|
-
*/
|
708
|
-
struct _xmlSchemaValidCtxt {
|
709
|
-
int type;
|
710
|
-
void *errCtxt;
|
711
|
-
/* user specific data block */
|
712
|
-
xmlSchemaValidityErrorFunc error;
|
713
|
-
/* the callback in case of errors */
|
714
|
-
xmlSchemaValidityWarningFunc warning;
|
715
|
-
/* the callback in case of warning */
|
716
|
-
xmlStructuredErrorFunc serror;
|
717
|
-
|
718
|
-
xmlSchemaPtr schema;
|
719
|
-
/* The schema in use */
|
720
|
-
xmlDocPtr doc;
|
721
|
-
xmlParserInputBufferPtr input;
|
722
|
-
xmlCharEncoding enc;
|
723
|
-
xmlSAXHandlerPtr sax;
|
724
|
-
xmlParserCtxtPtr parserCtxt;
|
725
|
-
void *user_data;
|
726
|
-
/* TODO: What is this for? */
|
727
|
-
|
728
|
-
int err;
|
729
|
-
int nberrors;
|
730
|
-
|
731
|
-
xmlNodePtr node;
|
732
|
-
xmlNodePtr cur;
|
733
|
-
/* xmlSchemaTypePtr type; */
|
734
|
-
|
735
|
-
xmlRegExecCtxtPtr regexp;
|
736
|
-
xmlSchemaValPtr value;
|
737
|
-
|
738
|
-
int valueWS;
|
739
|
-
int options;
|
740
|
-
xmlNodePtr validationRoot;
|
741
|
-
xmlSchemaParserCtxtPtr pctxt;
|
742
|
-
int xsiAssemble;
|
743
|
-
|
744
|
-
int depth;
|
745
|
-
xmlSchemaNodeInfoPtr *elemInfos;
|
746
|
-
/* array of element informations */
|
747
|
-
int sizeElemInfos;
|
748
|
-
xmlSchemaNodeInfoPtr inode;
|
749
|
-
/* the current element information */
|
750
|
-
|
751
|
-
xmlSchemaIDCAugPtr aidcs;
|
752
|
-
/* a list of augmented IDC informations */
|
753
|
-
|
754
|
-
xmlSchemaIDCStateObjPtr xpathStates;
|
755
|
-
/* first active state object. */
|
756
|
-
xmlSchemaIDCStateObjPtr xpathStatePool;
|
757
|
-
/* first stored state object. */
|
758
|
-
xmlSchemaIDCMatcherPtr idcMatcherCache;
|
759
|
-
/* Cache for IDC matcher objects. */
|
760
|
-
|
761
|
-
xmlSchemaPSVIIDCNodePtr *idcNodes;
|
762
|
-
/* list of all IDC node-table entries*/
|
763
|
-
int nbIdcNodes;
|
764
|
-
int sizeIdcNodes;
|
765
|
-
|
766
|
-
xmlSchemaPSVIIDCKeyPtr *idcKeys;
|
767
|
-
/* list of all IDC node-table entries */
|
768
|
-
int nbIdcKeys;
|
769
|
-
int sizeIdcKeys;
|
770
|
-
|
771
|
-
int flags;
|
772
|
-
|
773
|
-
xmlDictPtr dict;
|
774
|
-
|
775
|
-
#ifdef LIBXML_READER_ENABLED
|
776
|
-
xmlTextReaderPtr reader;
|
777
|
-
#endif
|
778
|
-
|
779
|
-
xmlSchemaAttrInfoPtr *attrInfos;
|
780
|
-
int nbAttrInfos;
|
781
|
-
int sizeAttrInfos;
|
782
|
-
|
783
|
-
int skipDepth;
|
784
|
-
xmlSchemaItemListPtr nodeQNames;
|
785
|
-
int hasKeyrefs;
|
786
|
-
int createIDCNodeTables;
|
787
|
-
int psviExposeIDCNodeTables;
|
788
|
-
};
|
789
|
-
|
790
|
-
/**
|
791
|
-
* xmlSchemaSubstGroup:
|
792
|
-
*
|
793
|
-
*
|
794
|
-
*/
|
795
|
-
typedef struct _xmlSchemaSubstGroup xmlSchemaSubstGroup;
|
796
|
-
typedef xmlSchemaSubstGroup *xmlSchemaSubstGroupPtr;
|
797
|
-
struct _xmlSchemaSubstGroup {
|
798
|
-
xmlSchemaElementPtr head;
|
799
|
-
xmlSchemaItemListPtr members;
|
800
|
-
};
|
801
|
-
|
802
|
-
/*static xmlSchemaQNameRefPtr
|
803
|
-
xmlSchemaParseAttributeGroupRef(xmlSchemaParserCtxtPtr pctxt,
|
804
|
-
xmlSchemaPtr schema,
|
805
|
-
xmlNodePtr node);*/
|
806
|
-
|
807
|
-
|
808
|
-
#endif
|
809
|
-
|
1
|
+
#ifndef __RXML_SCHEMA__
|
2
|
+
#define __RXML_SCHEMA__
|
3
|
+
|
4
|
+
#include <libxml/schemasInternals.h>
|
5
|
+
#include <libxml/xmlschemas.h>
|
6
|
+
#include <libxml/xmlschemastypes.h>
|
7
|
+
|
8
|
+
extern VALUE cXMLSchema;
|
9
|
+
|
10
|
+
void rxml_init_schema(void);
|
11
|
+
|
12
|
+
#define QNIL_OR_STRING(slot) \
|
13
|
+
if (slot == NULL) \
|
14
|
+
return Qnil; \
|
15
|
+
else \
|
16
|
+
return rb_str_new2((const char *)slot);
|
17
|
+
|
18
|
+
#define SUBSET_RESTRICTION 1<<0
|
19
|
+
#define SUBSET_EXTENSION 1<<1
|
20
|
+
#define SUBSET_SUBSTITUTION 1<<2
|
21
|
+
#define SUBSET_LIST 1<<3
|
22
|
+
#define SUBSET_UNION 1<<4
|
23
|
+
|
24
|
+
typedef struct _xmlSchemaNodeInfo xmlSchemaNodeInfo;
|
25
|
+
typedef xmlSchemaNodeInfo *xmlSchemaNodeInfoPtr;
|
26
|
+
|
27
|
+
typedef struct _xmlSchemaItemList xmlSchemaItemList;
|
28
|
+
typedef xmlSchemaItemList *xmlSchemaItemListPtr;
|
29
|
+
struct _xmlSchemaItemList {
|
30
|
+
void **items;
|
31
|
+
/* used for dynamic addition of schemata */
|
32
|
+
int nbItems;
|
33
|
+
/* used for dynamic addition of schemata */
|
34
|
+
int sizeItems; /* used for dynamic addition of schemata */
|
35
|
+
};
|
36
|
+
|
37
|
+
#define XML_SCHEMA_CTXT_PARSER 1
|
38
|
+
#define XML_SCHEMA_CTXT_VALIDATOR 2
|
39
|
+
|
40
|
+
typedef struct _xmlSchemaAbstractCtxt xmlSchemaAbstractCtxt;
|
41
|
+
typedef xmlSchemaAbstractCtxt *xmlSchemaAbstractCtxtPtr;
|
42
|
+
struct _xmlSchemaAbstractCtxt {
|
43
|
+
int type; /* E.g. XML_SCHEMA_CTXT_VALIDATOR */
|
44
|
+
};
|
45
|
+
|
46
|
+
typedef struct _xmlSchemaBucket xmlSchemaBucket;
|
47
|
+
typedef xmlSchemaBucket *xmlSchemaBucketPtr;
|
48
|
+
|
49
|
+
#define XML_SCHEMA_SCHEMA_MAIN 0
|
50
|
+
#define XML_SCHEMA_SCHEMA_IMPORT 1
|
51
|
+
#define XML_SCHEMA_SCHEMA_INCLUDE 2
|
52
|
+
#define XML_SCHEMA_SCHEMA_REDEFINE 3
|
53
|
+
|
54
|
+
/**
|
55
|
+
* xmlSchemaSchemaRelation:
|
56
|
+
*
|
57
|
+
* Used to create a graph of schema relationships.
|
58
|
+
*/
|
59
|
+
typedef struct _xmlSchemaSchemaRelation xmlSchemaSchemaRelation;
|
60
|
+
typedef xmlSchemaSchemaRelation *xmlSchemaSchemaRelationPtr;
|
61
|
+
struct _xmlSchemaSchemaRelation {
|
62
|
+
xmlSchemaSchemaRelationPtr next;
|
63
|
+
int type;
|
64
|
+
/* E.g. XML_SCHEMA_SCHEMA_IMPORT */
|
65
|
+
const xmlChar *importNamespace;
|
66
|
+
xmlSchemaBucketPtr bucket;
|
67
|
+
};
|
68
|
+
|
69
|
+
#define XML_SCHEMA_BUCKET_MARKED 1<<0
|
70
|
+
#define XML_SCHEMA_BUCKET_COMPS_ADDED 1<<1
|
71
|
+
|
72
|
+
struct _xmlSchemaBucket {
|
73
|
+
int type;
|
74
|
+
int flags;
|
75
|
+
const xmlChar *schemaLocation;
|
76
|
+
const xmlChar *origTargetNamespace;
|
77
|
+
const xmlChar *targetNamespace;
|
78
|
+
xmlDocPtr doc;
|
79
|
+
xmlSchemaSchemaRelationPtr relations;
|
80
|
+
int located;
|
81
|
+
int parsed;
|
82
|
+
int imported;
|
83
|
+
int preserveDoc;
|
84
|
+
xmlSchemaItemListPtr globals;
|
85
|
+
/* Global components. */
|
86
|
+
xmlSchemaItemListPtr locals; /* Local components. */
|
87
|
+
};
|
88
|
+
|
89
|
+
/**
|
90
|
+
* xmlSchemaImport:
|
91
|
+
* (extends xmlSchemaBucket)
|
92
|
+
*
|
93
|
+
* Reflects a schema. Holds some information
|
94
|
+
* about the schema and its toplevel components. Duplicate
|
95
|
+
* toplevel components are not checked at this level.
|
96
|
+
*/
|
97
|
+
typedef struct _xmlSchemaImport xmlSchemaImport;
|
98
|
+
typedef xmlSchemaImport *xmlSchemaImportPtr;
|
99
|
+
struct _xmlSchemaImport {
|
100
|
+
int type;
|
101
|
+
/* Main OR import OR include. */
|
102
|
+
int flags;
|
103
|
+
const xmlChar *schemaLocation; /* The URI of the schema document. */
|
104
|
+
/* For chameleon includes, @origTargetNamespace will be NULL */
|
105
|
+
const xmlChar *origTargetNamespace;
|
106
|
+
/*
|
107
|
+
* For chameleon includes, @targetNamespace will be the
|
108
|
+
* targetNamespace of the including schema.
|
109
|
+
*/
|
110
|
+
const xmlChar *targetNamespace;
|
111
|
+
xmlDocPtr doc; /* The schema node-tree. */
|
112
|
+
/* @relations will hold any included/imported/redefined schemas. */
|
113
|
+
xmlSchemaSchemaRelationPtr relations;
|
114
|
+
int located;
|
115
|
+
int parsed;
|
116
|
+
int imported;
|
117
|
+
int preserveDoc;
|
118
|
+
xmlSchemaItemListPtr globals;
|
119
|
+
xmlSchemaItemListPtr locals;
|
120
|
+
/* The imported schema. */
|
121
|
+
xmlSchemaPtr schema;
|
122
|
+
};
|
123
|
+
|
124
|
+
/*
|
125
|
+
* (extends xmlSchemaBucket)
|
126
|
+
*/
|
127
|
+
typedef struct _xmlSchemaInclude xmlSchemaInclude;
|
128
|
+
typedef xmlSchemaInclude *xmlSchemaIncludePtr;
|
129
|
+
struct _xmlSchemaInclude {
|
130
|
+
int type;
|
131
|
+
int flags;
|
132
|
+
const xmlChar *schemaLocation;
|
133
|
+
const xmlChar *origTargetNamespace;
|
134
|
+
const xmlChar *targetNamespace;
|
135
|
+
xmlDocPtr doc;
|
136
|
+
xmlSchemaSchemaRelationPtr relations;
|
137
|
+
int located;
|
138
|
+
int parsed;
|
139
|
+
int imported;
|
140
|
+
int preserveDoc;
|
141
|
+
xmlSchemaItemListPtr globals;
|
142
|
+
/* Global components. */
|
143
|
+
xmlSchemaItemListPtr locals; /* Local components. */
|
144
|
+
|
145
|
+
/* The owning main or import schema bucket. */
|
146
|
+
xmlSchemaImportPtr ownerImport;
|
147
|
+
};
|
148
|
+
|
149
|
+
/**
|
150
|
+
* xmlSchemaBasicItem:
|
151
|
+
*
|
152
|
+
* The abstract base type for schema components.
|
153
|
+
*/
|
154
|
+
typedef struct _xmlSchemaBasicItem xmlSchemaBasicItem;
|
155
|
+
typedef xmlSchemaBasicItem *xmlSchemaBasicItemPtr;
|
156
|
+
struct _xmlSchemaBasicItem {
|
157
|
+
xmlSchemaTypeType type;
|
158
|
+
};
|
159
|
+
|
160
|
+
/**
|
161
|
+
* xmlSchemaAnnotItem:
|
162
|
+
*
|
163
|
+
* The abstract base type for annotated schema components.
|
164
|
+
* (Extends xmlSchemaBasicItem)
|
165
|
+
*/
|
166
|
+
typedef struct _xmlSchemaAnnotItem xmlSchemaAnnotItem;
|
167
|
+
typedef xmlSchemaAnnotItem *xmlSchemaAnnotItemPtr;
|
168
|
+
struct _xmlSchemaAnnotItem {
|
169
|
+
xmlSchemaTypeType type;
|
170
|
+
xmlSchemaAnnotPtr annot;
|
171
|
+
};
|
172
|
+
|
173
|
+
/**
|
174
|
+
* xmlSchemaTreeItem:
|
175
|
+
*
|
176
|
+
* The abstract base type for tree-like structured schema components.
|
177
|
+
* (Extends xmlSchemaAnnotItem)
|
178
|
+
*/
|
179
|
+
typedef struct _xmlSchemaTreeItem xmlSchemaTreeItem;
|
180
|
+
typedef xmlSchemaTreeItem *xmlSchemaTreeItemPtr;
|
181
|
+
struct _xmlSchemaTreeItem {
|
182
|
+
xmlSchemaTypeType type;
|
183
|
+
xmlSchemaAnnotPtr annot;
|
184
|
+
xmlSchemaTreeItemPtr next;
|
185
|
+
xmlSchemaTreeItemPtr children;
|
186
|
+
};
|
187
|
+
|
188
|
+
|
189
|
+
#define XML_SCHEMA_ATTR_USE_FIXED 1<<0
|
190
|
+
/**
|
191
|
+
* xmlSchemaAttributeUsePtr:
|
192
|
+
*
|
193
|
+
* The abstract base type for tree-like structured schema components.
|
194
|
+
* (Extends xmlSchemaTreeItem)
|
195
|
+
*/
|
196
|
+
typedef struct _xmlSchemaAttributeUse xmlSchemaAttributeUse;
|
197
|
+
typedef xmlSchemaAttributeUse *xmlSchemaAttributeUsePtr;
|
198
|
+
struct _xmlSchemaAttributeUse {
|
199
|
+
xmlSchemaTypeType type;
|
200
|
+
xmlSchemaAnnotPtr annot;
|
201
|
+
xmlSchemaAttributeUsePtr next; /* The next attr. use. */
|
202
|
+
/*
|
203
|
+
* The attr. decl. OR a QName-ref. to an attr. decl. OR
|
204
|
+
* a QName-ref. to an attribute group definition.
|
205
|
+
*/
|
206
|
+
xmlSchemaAttributePtr attrDecl;
|
207
|
+
|
208
|
+
int flags;
|
209
|
+
xmlNodePtr node;
|
210
|
+
int occurs;
|
211
|
+
/* required, optional */
|
212
|
+
const xmlChar *defValue;
|
213
|
+
xmlSchemaValPtr defVal;
|
214
|
+
};
|
215
|
+
|
216
|
+
/**
|
217
|
+
* xmlSchemaAttributeUseProhibPtr:
|
218
|
+
*
|
219
|
+
* A helper component to reflect attribute prohibitions.
|
220
|
+
* (Extends xmlSchemaBasicItem)
|
221
|
+
*/
|
222
|
+
typedef struct _xmlSchemaAttributeUseProhib xmlSchemaAttributeUseProhib;
|
223
|
+
typedef xmlSchemaAttributeUseProhib *xmlSchemaAttributeUseProhibPtr;
|
224
|
+
struct _xmlSchemaAttributeUseProhib {
|
225
|
+
xmlSchemaTypeType type;
|
226
|
+
/* == XML_SCHEMA_EXTRA_ATTR_USE_PROHIB */
|
227
|
+
xmlNodePtr node;
|
228
|
+
const xmlChar *name;
|
229
|
+
const xmlChar *targetNamespace;
|
230
|
+
int isRef;
|
231
|
+
};
|
232
|
+
|
233
|
+
/**
|
234
|
+
* xmlSchemaRedef:
|
235
|
+
*/
|
236
|
+
typedef struct _xmlSchemaRedef xmlSchemaRedef;
|
237
|
+
typedef xmlSchemaRedef *xmlSchemaRedefPtr;
|
238
|
+
struct _xmlSchemaRedef {
|
239
|
+
xmlSchemaRedefPtr next;
|
240
|
+
xmlSchemaBasicItemPtr item;
|
241
|
+
/* The redefining component. */
|
242
|
+
xmlSchemaBasicItemPtr reference;
|
243
|
+
/* The referencing component. */
|
244
|
+
xmlSchemaBasicItemPtr target;
|
245
|
+
/* The to-be-redefined component. */
|
246
|
+
const xmlChar *refName;
|
247
|
+
/* The name of the to-be-redefined component. */
|
248
|
+
const xmlChar *refTargetNs;
|
249
|
+
/* The target namespace of the
|
250
|
+
to-be-redefined comp. */
|
251
|
+
xmlSchemaBucketPtr targetBucket; /* The redefined schema. */
|
252
|
+
};
|
253
|
+
|
254
|
+
/**
|
255
|
+
* xmlSchemaConstructionCtxt:
|
256
|
+
*/
|
257
|
+
typedef struct _xmlSchemaConstructionCtxt xmlSchemaConstructionCtxt;
|
258
|
+
typedef xmlSchemaConstructionCtxt *xmlSchemaConstructionCtxtPtr;
|
259
|
+
struct _xmlSchemaConstructionCtxt {
|
260
|
+
xmlSchemaPtr mainSchema;
|
261
|
+
/* The main schema. */
|
262
|
+
xmlSchemaBucketPtr mainBucket;
|
263
|
+
/* The main schema bucket */
|
264
|
+
xmlDictPtr dict;
|
265
|
+
xmlSchemaItemListPtr buckets; /* List of schema buckets. */
|
266
|
+
/* xmlSchemaItemListPtr relations; */ /* List of schema relations. */
|
267
|
+
xmlSchemaBucketPtr bucket;
|
268
|
+
/* The current schema bucket */
|
269
|
+
xmlSchemaItemListPtr pending;
|
270
|
+
/* All Components of all schemas that
|
271
|
+
need to be fixed. */
|
272
|
+
xmlHashTablePtr substGroups;
|
273
|
+
xmlSchemaRedefPtr redefs;
|
274
|
+
xmlSchemaRedefPtr lastRedef;
|
275
|
+
};
|
276
|
+
|
277
|
+
#define XML_SCHEMAS_PARSE_ERROR 1
|
278
|
+
#define SCHEMAS_PARSE_OPTIONS XML_PARSE_NOENT
|
279
|
+
|
280
|
+
struct _xmlSchemaParserCtxt {
|
281
|
+
int type;
|
282
|
+
void *errCtxt;
|
283
|
+
/* user specific error context */
|
284
|
+
xmlSchemaValidityErrorFunc error;
|
285
|
+
/* the callback in case of errors */
|
286
|
+
xmlSchemaValidityWarningFunc warning;
|
287
|
+
/* the callback in case of warning */
|
288
|
+
int err;
|
289
|
+
int nberrors;
|
290
|
+
xmlStructuredErrorFunc serror;
|
291
|
+
|
292
|
+
xmlSchemaConstructionCtxtPtr constructor;
|
293
|
+
int ownsConstructor; /* TODO: Move this to parser *flags*. */
|
294
|
+
|
295
|
+
/* xmlSchemaPtr topschema; */
|
296
|
+
/* xmlHashTablePtr namespaces; */
|
297
|
+
|
298
|
+
xmlSchemaPtr schema;
|
299
|
+
/* The main schema in use */
|
300
|
+
int counter;
|
301
|
+
|
302
|
+
const xmlChar *URL;
|
303
|
+
xmlDocPtr doc;
|
304
|
+
int preserve;
|
305
|
+
/* Whether the doc should be freed */
|
306
|
+
|
307
|
+
const char *buffer;
|
308
|
+
int size;
|
309
|
+
|
310
|
+
/*
|
311
|
+
* Used to build complex element content models
|
312
|
+
*/
|
313
|
+
xmlAutomataPtr am;
|
314
|
+
xmlAutomataStatePtr start;
|
315
|
+
xmlAutomataStatePtr end;
|
316
|
+
xmlAutomataStatePtr state;
|
317
|
+
|
318
|
+
xmlDictPtr dict;
|
319
|
+
/* dictionnary for interned string names */
|
320
|
+
xmlSchemaTypePtr ctxtType;
|
321
|
+
/* The current context simple/complex type */
|
322
|
+
int options;
|
323
|
+
xmlSchemaValidCtxtPtr vctxt;
|
324
|
+
int isS4S;
|
325
|
+
int isRedefine;
|
326
|
+
int xsiAssemble;
|
327
|
+
int stop;
|
328
|
+
/* If the parser should stop; i.e. a critical error. */
|
329
|
+
const xmlChar *targetNamespace;
|
330
|
+
xmlSchemaBucketPtr redefined;
|
331
|
+
/* The schema to be redefined. */
|
332
|
+
|
333
|
+
xmlSchemaRedefPtr redef;
|
334
|
+
/* Used for redefinitions. */
|
335
|
+
int redefCounter;
|
336
|
+
/* Used for redefinitions. */
|
337
|
+
xmlSchemaItemListPtr attrProhibs;
|
338
|
+
};
|
339
|
+
|
340
|
+
/**
|
341
|
+
* xmlSchemaQNameRef:
|
342
|
+
*
|
343
|
+
* A component reference item (not a schema component)
|
344
|
+
* (Extends xmlSchemaBasicItem)
|
345
|
+
*/
|
346
|
+
typedef struct _xmlSchemaQNameRef xmlSchemaQNameRef;
|
347
|
+
typedef xmlSchemaQNameRef *xmlSchemaQNameRefPtr;
|
348
|
+
struct _xmlSchemaQNameRef {
|
349
|
+
xmlSchemaTypeType type;
|
350
|
+
xmlSchemaBasicItemPtr item;
|
351
|
+
/* The resolved referenced item. */
|
352
|
+
xmlSchemaTypeType itemType;
|
353
|
+
const xmlChar *name;
|
354
|
+
const xmlChar *targetNamespace;
|
355
|
+
xmlNodePtr node;
|
356
|
+
};
|
357
|
+
|
358
|
+
/**
|
359
|
+
* xmlSchemaParticle:
|
360
|
+
*
|
361
|
+
* A particle component.
|
362
|
+
* (Extends xmlSchemaTreeItem)
|
363
|
+
*/
|
364
|
+
typedef struct _xmlSchemaParticle xmlSchemaParticle;
|
365
|
+
typedef xmlSchemaParticle *xmlSchemaParticlePtr;
|
366
|
+
struct _xmlSchemaParticle {
|
367
|
+
xmlSchemaTypeType type;
|
368
|
+
xmlSchemaAnnotPtr annot;
|
369
|
+
xmlSchemaTreeItemPtr next;
|
370
|
+
/* next particle */
|
371
|
+
xmlSchemaTreeItemPtr children;
|
372
|
+
/* the "term" (e.g. a model group,
|
373
|
+
a group definition, a XML_SCHEMA_EXTRA_QNAMEREF (if a reference),
|
374
|
+
etc.) */
|
375
|
+
int minOccurs;
|
376
|
+
int maxOccurs;
|
377
|
+
xmlNodePtr node;
|
378
|
+
};
|
379
|
+
|
380
|
+
/**
|
381
|
+
* xmlSchemaModelGroup:
|
382
|
+
*
|
383
|
+
* A model group component.
|
384
|
+
* (Extends xmlSchemaTreeItem)
|
385
|
+
*/
|
386
|
+
typedef struct _xmlSchemaModelGroup xmlSchemaModelGroup;
|
387
|
+
typedef xmlSchemaModelGroup *xmlSchemaModelGroupPtr;
|
388
|
+
struct _xmlSchemaModelGroup {
|
389
|
+
xmlSchemaTypeType type;
|
390
|
+
/* XML_SCHEMA_TYPE_SEQUENCE, XML_SCHEMA_TYPE_CHOICE, XML_SCHEMA_TYPE_ALL */
|
391
|
+
xmlSchemaAnnotPtr annot;
|
392
|
+
xmlSchemaTreeItemPtr next;
|
393
|
+
/* not used */
|
394
|
+
xmlSchemaTreeItemPtr children;
|
395
|
+
/* first particle (OR "element decl" OR "wildcard") */
|
396
|
+
xmlNodePtr node;
|
397
|
+
};
|
398
|
+
|
399
|
+
#define XML_SCHEMA_MODEL_GROUP_DEF_MARKED 1<<0
|
400
|
+
#define XML_SCHEMA_MODEL_GROUP_DEF_REDEFINED 1<<1
|
401
|
+
/**
|
402
|
+
* xmlSchemaModelGroupDef:
|
403
|
+
*
|
404
|
+
* A model group definition component.
|
405
|
+
* (Extends xmlSchemaTreeItem)
|
406
|
+
*/
|
407
|
+
typedef struct _xmlSchemaModelGroupDef xmlSchemaModelGroupDef;
|
408
|
+
typedef xmlSchemaModelGroupDef *xmlSchemaModelGroupDefPtr;
|
409
|
+
struct _xmlSchemaModelGroupDef {
|
410
|
+
xmlSchemaTypeType type;
|
411
|
+
/* XML_SCHEMA_TYPE_GROUP */
|
412
|
+
xmlSchemaAnnotPtr annot;
|
413
|
+
xmlSchemaTreeItemPtr next;
|
414
|
+
/* not used */
|
415
|
+
xmlSchemaTreeItemPtr children;
|
416
|
+
/* the "model group" */
|
417
|
+
const xmlChar *name;
|
418
|
+
const xmlChar *targetNamespace;
|
419
|
+
xmlNodePtr node;
|
420
|
+
int flags;
|
421
|
+
};
|
422
|
+
|
423
|
+
typedef struct _xmlSchemaIDC xmlSchemaIDC;
|
424
|
+
typedef xmlSchemaIDC *xmlSchemaIDCPtr;
|
425
|
+
|
426
|
+
/**
|
427
|
+
* xmlSchemaIDCSelect:
|
428
|
+
*
|
429
|
+
* The identity-constraint "field" and "selector" item, holding the
|
430
|
+
* XPath expression.
|
431
|
+
*/
|
432
|
+
typedef struct _xmlSchemaIDCSelect xmlSchemaIDCSelect;
|
433
|
+
typedef xmlSchemaIDCSelect *xmlSchemaIDCSelectPtr;
|
434
|
+
struct _xmlSchemaIDCSelect {
|
435
|
+
xmlSchemaIDCSelectPtr next;
|
436
|
+
xmlSchemaIDCPtr idc;
|
437
|
+
int index;
|
438
|
+
/* an index position if significant for IDC key-sequences */
|
439
|
+
const xmlChar *xpath;
|
440
|
+
/* the XPath expression */
|
441
|
+
void *xpathComp; /* the compiled XPath expression */
|
442
|
+
};
|
443
|
+
|
444
|
+
/**
|
445
|
+
* xmlSchemaIDC:
|
446
|
+
*
|
447
|
+
* The identity-constraint definition component.
|
448
|
+
* (Extends xmlSchemaAnnotItem)
|
449
|
+
*/
|
450
|
+
|
451
|
+
struct _xmlSchemaIDC {
|
452
|
+
xmlSchemaTypeType type;
|
453
|
+
xmlSchemaAnnotPtr annot;
|
454
|
+
xmlSchemaIDCPtr next;
|
455
|
+
xmlNodePtr node;
|
456
|
+
const xmlChar *name;
|
457
|
+
const xmlChar *targetNamespace;
|
458
|
+
xmlSchemaIDCSelectPtr selector;
|
459
|
+
xmlSchemaIDCSelectPtr fields;
|
460
|
+
int nbFields;
|
461
|
+
xmlSchemaQNameRefPtr ref;
|
462
|
+
};
|
463
|
+
|
464
|
+
/**
|
465
|
+
* xmlSchemaIDCAug:
|
466
|
+
*
|
467
|
+
* The augmented IDC information used for validation.
|
468
|
+
*/
|
469
|
+
typedef struct _xmlSchemaIDCAug xmlSchemaIDCAug;
|
470
|
+
typedef xmlSchemaIDCAug *xmlSchemaIDCAugPtr;
|
471
|
+
struct _xmlSchemaIDCAug {
|
472
|
+
xmlSchemaIDCAugPtr next;
|
473
|
+
/* next in a list */
|
474
|
+
xmlSchemaIDCPtr def;
|
475
|
+
/* the IDC definition */
|
476
|
+
int keyrefDepth; /* the lowest tree level to which IDC
|
477
|
+
tables need to be bubbled upwards */
|
478
|
+
};
|
479
|
+
|
480
|
+
/**
|
481
|
+
* xmlSchemaPSVIIDCKeySequence:
|
482
|
+
*
|
483
|
+
* The key sequence of a node table item.
|
484
|
+
*/
|
485
|
+
typedef struct _xmlSchemaPSVIIDCKey xmlSchemaPSVIIDCKey;
|
486
|
+
typedef xmlSchemaPSVIIDCKey *xmlSchemaPSVIIDCKeyPtr;
|
487
|
+
struct _xmlSchemaPSVIIDCKey {
|
488
|
+
xmlSchemaTypePtr type;
|
489
|
+
xmlSchemaValPtr val;
|
490
|
+
};
|
491
|
+
|
492
|
+
/**
|
493
|
+
* xmlSchemaPSVIIDCNode:
|
494
|
+
*
|
495
|
+
* The node table item of a node table.
|
496
|
+
*/
|
497
|
+
typedef struct _xmlSchemaPSVIIDCNode xmlSchemaPSVIIDCNode;
|
498
|
+
typedef xmlSchemaPSVIIDCNode *xmlSchemaPSVIIDCNodePtr;
|
499
|
+
struct _xmlSchemaPSVIIDCNode {
|
500
|
+
xmlNodePtr node;
|
501
|
+
xmlSchemaPSVIIDCKeyPtr *keys;
|
502
|
+
int nodeLine;
|
503
|
+
int nodeQNameID;
|
504
|
+
|
505
|
+
};
|
506
|
+
|
507
|
+
/**
|
508
|
+
* xmlSchemaPSVIIDCBinding:
|
509
|
+
*
|
510
|
+
* The identity-constraint binding item of the [identity-constraint table].
|
511
|
+
*/
|
512
|
+
typedef struct _xmlSchemaPSVIIDCBinding xmlSchemaPSVIIDCBinding;
|
513
|
+
typedef xmlSchemaPSVIIDCBinding *xmlSchemaPSVIIDCBindingPtr;
|
514
|
+
struct _xmlSchemaPSVIIDCBinding {
|
515
|
+
xmlSchemaPSVIIDCBindingPtr next;
|
516
|
+
/* next binding of a specific node */
|
517
|
+
xmlSchemaIDCPtr definition;
|
518
|
+
/* the IDC definition */
|
519
|
+
xmlSchemaPSVIIDCNodePtr *nodeTable;
|
520
|
+
/* array of key-sequences */
|
521
|
+
int nbNodes;
|
522
|
+
/* number of entries in the node table */
|
523
|
+
int sizeNodes;
|
524
|
+
/* size of the node table */
|
525
|
+
xmlSchemaItemListPtr dupls;
|
526
|
+
};
|
527
|
+
|
528
|
+
|
529
|
+
#define XPATH_STATE_OBJ_TYPE_IDC_SELECTOR 1
|
530
|
+
#define XPATH_STATE_OBJ_TYPE_IDC_FIELD 2
|
531
|
+
|
532
|
+
#define XPATH_STATE_OBJ_MATCHES -2
|
533
|
+
#define XPATH_STATE_OBJ_BLOCKED -3
|
534
|
+
|
535
|
+
typedef struct _xmlSchemaIDCMatcher xmlSchemaIDCMatcher;
|
536
|
+
typedef xmlSchemaIDCMatcher *xmlSchemaIDCMatcherPtr;
|
537
|
+
|
538
|
+
/**
|
539
|
+
* xmlSchemaIDCStateObj:
|
540
|
+
*
|
541
|
+
* The state object used to evaluate XPath expressions.
|
542
|
+
*/
|
543
|
+
typedef struct _xmlSchemaIDCStateObj xmlSchemaIDCStateObj;
|
544
|
+
typedef xmlSchemaIDCStateObj *xmlSchemaIDCStateObjPtr;
|
545
|
+
struct _xmlSchemaIDCStateObj {
|
546
|
+
int type;
|
547
|
+
xmlSchemaIDCStateObjPtr next;
|
548
|
+
/* next if in a list */
|
549
|
+
int depth;
|
550
|
+
/* depth of creation */
|
551
|
+
int *history;
|
552
|
+
/* list of (depth, state-id) tuples */
|
553
|
+
int nbHistory;
|
554
|
+
int sizeHistory;
|
555
|
+
xmlSchemaIDCMatcherPtr matcher;
|
556
|
+
/* the correspondent field/selector
|
557
|
+
matcher */
|
558
|
+
xmlSchemaIDCSelectPtr sel;
|
559
|
+
void *xpathCtxt;
|
560
|
+
};
|
561
|
+
|
562
|
+
#define IDC_MATCHER 0
|
563
|
+
|
564
|
+
/**
|
565
|
+
* xmlSchemaIDCMatcher:
|
566
|
+
*
|
567
|
+
* Used to evaluate IDC selectors (and fields).
|
568
|
+
*/
|
569
|
+
struct _xmlSchemaIDCMatcher {
|
570
|
+
int type;
|
571
|
+
int depth;
|
572
|
+
/* the tree depth at creation time */
|
573
|
+
xmlSchemaIDCMatcherPtr next;
|
574
|
+
/* next in the list */
|
575
|
+
xmlSchemaIDCMatcherPtr nextCached;
|
576
|
+
/* next in the cache list */
|
577
|
+
xmlSchemaIDCAugPtr aidc;
|
578
|
+
/* the augmented IDC item */
|
579
|
+
int idcType;
|
580
|
+
xmlSchemaPSVIIDCKeyPtr **keySeqs;
|
581
|
+
/* the key-sequences of the target
|
582
|
+
elements */
|
583
|
+
int sizeKeySeqs;
|
584
|
+
xmlSchemaItemListPtr targets; /* list of target-node
|
585
|
+
(xmlSchemaPSVIIDCNodePtr) entries */
|
586
|
+
};
|
587
|
+
|
588
|
+
/*
|
589
|
+
* Element info flags.
|
590
|
+
*/
|
591
|
+
#define XML_SCHEMA_NODE_INFO_FLAG_OWNED_NAMES 1<<0
|
592
|
+
#define XML_SCHEMA_NODE_INFO_FLAG_OWNED_VALUES 1<<1
|
593
|
+
#define XML_SCHEMA_ELEM_INFO_NILLED 1<<2
|
594
|
+
#define XML_SCHEMA_ELEM_INFO_LOCAL_TYPE 1<<3
|
595
|
+
|
596
|
+
#define XML_SCHEMA_NODE_INFO_VALUE_NEEDED 1<<4
|
597
|
+
#define XML_SCHEMA_ELEM_INFO_EMPTY 1<<5
|
598
|
+
#define XML_SCHEMA_ELEM_INFO_HAS_CONTENT 1<<6
|
599
|
+
|
600
|
+
#define XML_SCHEMA_ELEM_INFO_HAS_ELEM_CONTENT 1<<7
|
601
|
+
#define XML_SCHEMA_ELEM_INFO_ERR_BAD_CONTENT 1<<8
|
602
|
+
#define XML_SCHEMA_NODE_INFO_ERR_NOT_EXPECTED 1<<9
|
603
|
+
#define XML_SCHEMA_NODE_INFO_ERR_BAD_TYPE 1<<10
|
604
|
+
|
605
|
+
/**
|
606
|
+
* xmlSchemaNodeInfo:
|
607
|
+
*
|
608
|
+
* Holds information of an element node.
|
609
|
+
*/
|
610
|
+
struct _xmlSchemaNodeInfo {
|
611
|
+
int nodeType;
|
612
|
+
xmlNodePtr node;
|
613
|
+
int nodeLine;
|
614
|
+
const xmlChar *localName;
|
615
|
+
const xmlChar *nsName;
|
616
|
+
const xmlChar *value;
|
617
|
+
xmlSchemaValPtr val;
|
618
|
+
/* the pre-computed value if any */
|
619
|
+
xmlSchemaTypePtr typeDef;
|
620
|
+
/* the complex/simple type definition if any */
|
621
|
+
|
622
|
+
int flags;
|
623
|
+
/* combination of node info flags */
|
624
|
+
|
625
|
+
int valNeeded;
|
626
|
+
int normVal;
|
627
|
+
|
628
|
+
xmlSchemaElementPtr decl;
|
629
|
+
/* the element/attribute declaration */
|
630
|
+
int depth;
|
631
|
+
xmlSchemaPSVIIDCBindingPtr idcTable;
|
632
|
+
/* the table of PSVI IDC bindings
|
633
|
+
for the scope element*/
|
634
|
+
xmlSchemaIDCMatcherPtr idcMatchers;
|
635
|
+
/* the IDC matchers for the scope
|
636
|
+
element */
|
637
|
+
xmlRegExecCtxtPtr regexCtxt;
|
638
|
+
|
639
|
+
const xmlChar **nsBindings;
|
640
|
+
/* Namespace bindings on this element */
|
641
|
+
int nbNsBindings;
|
642
|
+
int sizeNsBindings;
|
643
|
+
|
644
|
+
int hasKeyrefs;
|
645
|
+
int appliedXPath; /* Indicates that an XPath has been applied. */
|
646
|
+
};
|
647
|
+
|
648
|
+
#define XML_SCHEMAS_ATTR_UNKNOWN 1
|
649
|
+
#define XML_SCHEMAS_ATTR_ASSESSED 2
|
650
|
+
#define XML_SCHEMAS_ATTR_PROHIBITED 3
|
651
|
+
#define XML_SCHEMAS_ATTR_ERR_MISSING 4
|
652
|
+
#define XML_SCHEMAS_ATTR_INVALID_VALUE 5
|
653
|
+
#define XML_SCHEMAS_ATTR_ERR_NO_TYPE 6
|
654
|
+
#define XML_SCHEMAS_ATTR_ERR_FIXED_VALUE 7
|
655
|
+
#define XML_SCHEMAS_ATTR_DEFAULT 8
|
656
|
+
#define XML_SCHEMAS_ATTR_VALIDATE_VALUE 9
|
657
|
+
#define XML_SCHEMAS_ATTR_ERR_WILD_STRICT_NO_DECL 10
|
658
|
+
#define XML_SCHEMAS_ATTR_HAS_ATTR_USE 11
|
659
|
+
#define XML_SCHEMAS_ATTR_HAS_ATTR_DECL 12
|
660
|
+
#define XML_SCHEMAS_ATTR_WILD_SKIP 13
|
661
|
+
#define XML_SCHEMAS_ATTR_WILD_LAX_NO_DECL 14
|
662
|
+
#define XML_SCHEMAS_ATTR_ERR_WILD_DUPLICATE_ID 15
|
663
|
+
#define XML_SCHEMAS_ATTR_ERR_WILD_AND_USE_ID 16
|
664
|
+
#define XML_SCHEMAS_ATTR_META 17
|
665
|
+
/*
|
666
|
+
* @metaType values of xmlSchemaAttrInfo.
|
667
|
+
*/
|
668
|
+
#define XML_SCHEMA_ATTR_INFO_META_XSI_TYPE 1
|
669
|
+
#define XML_SCHEMA_ATTR_INFO_META_XSI_NIL 2
|
670
|
+
#define XML_SCHEMA_ATTR_INFO_META_XSI_SCHEMA_LOC 3
|
671
|
+
#define XML_SCHEMA_ATTR_INFO_META_XSI_NO_NS_SCHEMA_LOC 4
|
672
|
+
#define XML_SCHEMA_ATTR_INFO_META_XMLNS 5
|
673
|
+
|
674
|
+
typedef struct _xmlSchemaAttrInfo xmlSchemaAttrInfo;
|
675
|
+
typedef xmlSchemaAttrInfo *xmlSchemaAttrInfoPtr;
|
676
|
+
struct _xmlSchemaAttrInfo {
|
677
|
+
int nodeType;
|
678
|
+
xmlNodePtr node;
|
679
|
+
int nodeLine;
|
680
|
+
const xmlChar *localName;
|
681
|
+
const xmlChar *nsName;
|
682
|
+
const xmlChar *value;
|
683
|
+
xmlSchemaValPtr val;
|
684
|
+
/* the pre-computed value if any */
|
685
|
+
xmlSchemaTypePtr typeDef;
|
686
|
+
/* the complex/simple type definition if any */
|
687
|
+
int flags;
|
688
|
+
/* combination of node info flags */
|
689
|
+
|
690
|
+
xmlSchemaAttributePtr decl;
|
691
|
+
/* the attribute declaration */
|
692
|
+
xmlSchemaAttributeUsePtr use;
|
693
|
+
/* the attribute use */
|
694
|
+
int state;
|
695
|
+
int metaType;
|
696
|
+
const xmlChar *vcValue;
|
697
|
+
/* the value constraint value */
|
698
|
+
xmlSchemaNodeInfoPtr parent;
|
699
|
+
};
|
700
|
+
|
701
|
+
|
702
|
+
#define XML_SCHEMA_VALID_CTXT_FLAG_STREAM 1
|
703
|
+
/**
|
704
|
+
* xmlSchemaValidCtxt:
|
705
|
+
*
|
706
|
+
* A Schemas validation context
|
707
|
+
*/
|
708
|
+
struct _xmlSchemaValidCtxt {
|
709
|
+
int type;
|
710
|
+
void *errCtxt;
|
711
|
+
/* user specific data block */
|
712
|
+
xmlSchemaValidityErrorFunc error;
|
713
|
+
/* the callback in case of errors */
|
714
|
+
xmlSchemaValidityWarningFunc warning;
|
715
|
+
/* the callback in case of warning */
|
716
|
+
xmlStructuredErrorFunc serror;
|
717
|
+
|
718
|
+
xmlSchemaPtr schema;
|
719
|
+
/* The schema in use */
|
720
|
+
xmlDocPtr doc;
|
721
|
+
xmlParserInputBufferPtr input;
|
722
|
+
xmlCharEncoding enc;
|
723
|
+
xmlSAXHandlerPtr sax;
|
724
|
+
xmlParserCtxtPtr parserCtxt;
|
725
|
+
void *user_data;
|
726
|
+
/* TODO: What is this for? */
|
727
|
+
|
728
|
+
int err;
|
729
|
+
int nberrors;
|
730
|
+
|
731
|
+
xmlNodePtr node;
|
732
|
+
xmlNodePtr cur;
|
733
|
+
/* xmlSchemaTypePtr type; */
|
734
|
+
|
735
|
+
xmlRegExecCtxtPtr regexp;
|
736
|
+
xmlSchemaValPtr value;
|
737
|
+
|
738
|
+
int valueWS;
|
739
|
+
int options;
|
740
|
+
xmlNodePtr validationRoot;
|
741
|
+
xmlSchemaParserCtxtPtr pctxt;
|
742
|
+
int xsiAssemble;
|
743
|
+
|
744
|
+
int depth;
|
745
|
+
xmlSchemaNodeInfoPtr *elemInfos;
|
746
|
+
/* array of element informations */
|
747
|
+
int sizeElemInfos;
|
748
|
+
xmlSchemaNodeInfoPtr inode;
|
749
|
+
/* the current element information */
|
750
|
+
|
751
|
+
xmlSchemaIDCAugPtr aidcs;
|
752
|
+
/* a list of augmented IDC informations */
|
753
|
+
|
754
|
+
xmlSchemaIDCStateObjPtr xpathStates;
|
755
|
+
/* first active state object. */
|
756
|
+
xmlSchemaIDCStateObjPtr xpathStatePool;
|
757
|
+
/* first stored state object. */
|
758
|
+
xmlSchemaIDCMatcherPtr idcMatcherCache;
|
759
|
+
/* Cache for IDC matcher objects. */
|
760
|
+
|
761
|
+
xmlSchemaPSVIIDCNodePtr *idcNodes;
|
762
|
+
/* list of all IDC node-table entries*/
|
763
|
+
int nbIdcNodes;
|
764
|
+
int sizeIdcNodes;
|
765
|
+
|
766
|
+
xmlSchemaPSVIIDCKeyPtr *idcKeys;
|
767
|
+
/* list of all IDC node-table entries */
|
768
|
+
int nbIdcKeys;
|
769
|
+
int sizeIdcKeys;
|
770
|
+
|
771
|
+
int flags;
|
772
|
+
|
773
|
+
xmlDictPtr dict;
|
774
|
+
|
775
|
+
#ifdef LIBXML_READER_ENABLED
|
776
|
+
xmlTextReaderPtr reader;
|
777
|
+
#endif
|
778
|
+
|
779
|
+
xmlSchemaAttrInfoPtr *attrInfos;
|
780
|
+
int nbAttrInfos;
|
781
|
+
int sizeAttrInfos;
|
782
|
+
|
783
|
+
int skipDepth;
|
784
|
+
xmlSchemaItemListPtr nodeQNames;
|
785
|
+
int hasKeyrefs;
|
786
|
+
int createIDCNodeTables;
|
787
|
+
int psviExposeIDCNodeTables;
|
788
|
+
};
|
789
|
+
|
790
|
+
/**
|
791
|
+
* xmlSchemaSubstGroup:
|
792
|
+
*
|
793
|
+
*
|
794
|
+
*/
|
795
|
+
typedef struct _xmlSchemaSubstGroup xmlSchemaSubstGroup;
|
796
|
+
typedef xmlSchemaSubstGroup *xmlSchemaSubstGroupPtr;
|
797
|
+
struct _xmlSchemaSubstGroup {
|
798
|
+
xmlSchemaElementPtr head;
|
799
|
+
xmlSchemaItemListPtr members;
|
800
|
+
};
|
801
|
+
|
802
|
+
/*static xmlSchemaQNameRefPtr
|
803
|
+
xmlSchemaParseAttributeGroupRef(xmlSchemaParserCtxtPtr pctxt,
|
804
|
+
xmlSchemaPtr schema,
|
805
|
+
xmlNodePtr node);*/
|
806
|
+
|
807
|
+
|
808
|
+
#endif
|
809
|
+
|