libxml-ruby 3.2.3-x64-mingw-ucrt → 4.0.0-x64-mingw-ucrt

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