2
* Summary: internal interfaces for XML Schemas
3
* Description: internal interfaces for the XML Schemas handling
4
* and schema validity checking
5
* The Schemas development is a Work In Progress.
6
* Some of those interfaces are not garanteed to be API or ABI stable !
8
* Copy: See Copyright for the status of this software.
10
* Author: Daniel Veillard
14
#ifndef __XML_SCHEMA_INTERNALS_H__
15
#define __XML_SCHEMA_INTERNALS_H__
17
#include <libxml/xmlversion.h>
19
#ifdef LIBXML_SCHEMAS_ENABLED
21
#include <libxml/xmlregexp.h>
22
#include <libxml/hash.h>
23
#include <libxml/dict.h>
30
XML_SCHEMAS_UNKNOWN = 0,
32
XML_SCHEMAS_NORMSTRING,
37
XML_SCHEMAS_GMONTHDAY,
39
XML_SCHEMAS_GYEARMONTH,
61
XML_SCHEMAS_NPINTEGER,
63
XML_SCHEMAS_NNINTEGER,
73
XML_SCHEMAS_HEXBINARY,
74
XML_SCHEMAS_BASE64BINARY,
76
XML_SCHEMAS_ANYSIMPLETYPE
80
* XML Schemas defines multiple type of types.
83
XML_SCHEMA_TYPE_BASIC = 1, /* A built-in datatype */
85
XML_SCHEMA_TYPE_FACET,
86
XML_SCHEMA_TYPE_SIMPLE,
87
XML_SCHEMA_TYPE_COMPLEX,
88
XML_SCHEMA_TYPE_SEQUENCE = 6,
89
XML_SCHEMA_TYPE_CHOICE,
91
XML_SCHEMA_TYPE_SIMPLE_CONTENT,
92
XML_SCHEMA_TYPE_COMPLEX_CONTENT,
94
XML_SCHEMA_TYPE_RESTRICTION,
95
XML_SCHEMA_TYPE_EXTENSION,
96
XML_SCHEMA_TYPE_ELEMENT,
97
XML_SCHEMA_TYPE_ATTRIBUTE,
98
XML_SCHEMA_TYPE_ATTRIBUTEGROUP,
99
XML_SCHEMA_TYPE_GROUP,
100
XML_SCHEMA_TYPE_NOTATION,
101
XML_SCHEMA_TYPE_LIST,
102
XML_SCHEMA_TYPE_UNION,
103
XML_SCHEMA_TYPE_ANY_ATTRIBUTE,
104
XML_SCHEMA_TYPE_IDC_UNIQUE,
105
XML_SCHEMA_TYPE_IDC_KEY,
106
XML_SCHEMA_TYPE_IDC_KEYREF,
107
XML_SCHEMA_TYPE_PARTICLE = 25,
108
XML_SCHEMA_TYPE_ATTRIBUTE_USE,
109
XML_SCHEMA_FACET_MININCLUSIVE = 1000,
110
XML_SCHEMA_FACET_MINEXCLUSIVE,
111
XML_SCHEMA_FACET_MAXINCLUSIVE,
112
XML_SCHEMA_FACET_MAXEXCLUSIVE,
113
XML_SCHEMA_FACET_TOTALDIGITS,
114
XML_SCHEMA_FACET_FRACTIONDIGITS,
115
XML_SCHEMA_FACET_PATTERN,
116
XML_SCHEMA_FACET_ENUMERATION,
117
XML_SCHEMA_FACET_WHITESPACE,
118
XML_SCHEMA_FACET_LENGTH,
119
XML_SCHEMA_FACET_MAXLENGTH,
120
XML_SCHEMA_FACET_MINLENGTH,
121
XML_SCHEMA_EXTRA_QNAMEREF = 2000,
122
XML_SCHEMA_EXTRA_ATTR_USE_PROHIB
126
XML_SCHEMA_CONTENT_UNKNOWN = 0,
127
XML_SCHEMA_CONTENT_EMPTY = 1,
128
XML_SCHEMA_CONTENT_ELEMENTS,
129
XML_SCHEMA_CONTENT_MIXED,
130
XML_SCHEMA_CONTENT_SIMPLE,
131
XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS, /* Obsolete */
132
XML_SCHEMA_CONTENT_BASIC,
133
XML_SCHEMA_CONTENT_ANY
134
} xmlSchemaContentType;
136
typedef struct _xmlSchemaVal xmlSchemaVal;
137
typedef xmlSchemaVal *xmlSchemaValPtr;
139
typedef struct _xmlSchemaType xmlSchemaType;
140
typedef xmlSchemaType *xmlSchemaTypePtr;
142
typedef struct _xmlSchemaFacet xmlSchemaFacet;
143
typedef xmlSchemaFacet *xmlSchemaFacetPtr;
148
typedef struct _xmlSchemaAnnot xmlSchemaAnnot;
149
typedef xmlSchemaAnnot *xmlSchemaAnnotPtr;
150
struct _xmlSchemaAnnot {
151
struct _xmlSchemaAnnot *next;
152
xmlNodePtr content; /* the annotation */
156
* XML_SCHEMAS_ANYATTR_SKIP:
158
* Skip unknown attribute from validation
159
* Obsolete, not used anymore.
161
#define XML_SCHEMAS_ANYATTR_SKIP 1
163
* XML_SCHEMAS_ANYATTR_LAX:
165
* Ignore validation non definition on attributes
166
* Obsolete, not used anymore.
168
#define XML_SCHEMAS_ANYATTR_LAX 2
170
* XML_SCHEMAS_ANYATTR_STRICT:
172
* Apply strict validation rules on attributes
173
* Obsolete, not used anymore.
175
#define XML_SCHEMAS_ANYATTR_STRICT 3
177
* XML_SCHEMAS_ANY_SKIP:
179
* Skip unknown attribute from validation
181
#define XML_SCHEMAS_ANY_SKIP 1
183
* XML_SCHEMAS_ANY_LAX:
186
* Validate if type found, don't worry if not found
188
#define XML_SCHEMAS_ANY_LAX 2
190
* XML_SCHEMAS_ANY_STRICT:
193
* Apply strict validation rules
195
#define XML_SCHEMAS_ANY_STRICT 3
197
* XML_SCHEMAS_ATTR_USE_PROHIBITED:
200
* The attribute is prohibited.
202
#define XML_SCHEMAS_ATTR_USE_PROHIBITED 0
204
* XML_SCHEMAS_ATTR_USE_REQUIRED:
206
* The attribute is required.
208
#define XML_SCHEMAS_ATTR_USE_REQUIRED 1
210
* XML_SCHEMAS_ATTR_USE_OPTIONAL:
212
* The attribute is optional.
214
#define XML_SCHEMAS_ATTR_USE_OPTIONAL 2
216
* XML_SCHEMAS_ATTR_GLOBAL:
218
* allow elements in no namespace
220
#define XML_SCHEMAS_ATTR_GLOBAL 1 << 0
222
* XML_SCHEMAS_ATTR_NSDEFAULT:
224
* allow elements in no namespace
226
#define XML_SCHEMAS_ATTR_NSDEFAULT 1 << 7
228
* XML_SCHEMAS_ATTR_INTERNAL_RESOLVED:
230
* this is set when the "type" and "ref" references
231
* have been resolved.
233
#define XML_SCHEMAS_ATTR_INTERNAL_RESOLVED 1 << 8
235
* XML_SCHEMAS_ATTR_FIXED:
237
* the attribute has a fixed value
239
#define XML_SCHEMAS_ATTR_FIXED 1 << 9
242
* xmlSchemaAttribute:
243
* An attribute definition.
246
typedef struct _xmlSchemaAttribute xmlSchemaAttribute;
247
typedef xmlSchemaAttribute *xmlSchemaAttributePtr;
248
struct _xmlSchemaAttribute {
249
xmlSchemaTypeType type;
250
struct _xmlSchemaAttribute *next; /* the next attribute (not used?) */
251
const xmlChar *name; /* the name of the declaration */
252
const xmlChar *id; /* Deprecated; not used */
253
const xmlChar *ref; /* Deprecated; not used */
254
const xmlChar *refNs; /* Deprecated; not used */
255
const xmlChar *typeName; /* the local name of the type definition */
256
const xmlChar *typeNs; /* the ns URI of the type definition */
257
xmlSchemaAnnotPtr annot;
259
xmlSchemaTypePtr base; /* Deprecated; not used */
260
int occurs; /* Deprecated; not used */
261
const xmlChar *defValue; /* The initial value of the value constraint */
262
xmlSchemaTypePtr subtypes; /* the type definition */
264
const xmlChar *targetNamespace;
266
const xmlChar *refPrefix; /* Deprecated; not used */
267
xmlSchemaValPtr defVal; /* The compiled value constraint */
268
xmlSchemaAttributePtr refDecl; /* Deprecated; not used */
272
* xmlSchemaAttributeLink:
273
* Used to build a list of attribute uses on complexType definitions.
274
* WARNING: Deprecated; not used.
276
typedef struct _xmlSchemaAttributeLink xmlSchemaAttributeLink;
277
typedef xmlSchemaAttributeLink *xmlSchemaAttributeLinkPtr;
278
struct _xmlSchemaAttributeLink {
279
struct _xmlSchemaAttributeLink *next;/* the next attribute link ... */
280
struct _xmlSchemaAttribute *attr;/* the linked attribute */
284
* XML_SCHEMAS_WILDCARD_COMPLETE:
286
* If the wildcard is complete.
288
#define XML_SCHEMAS_WILDCARD_COMPLETE 1 << 0
291
* xmlSchemaCharValueLink:
292
* Used to build a list of namespaces on wildcards.
294
typedef struct _xmlSchemaWildcardNs xmlSchemaWildcardNs;
295
typedef xmlSchemaWildcardNs *xmlSchemaWildcardNsPtr;
296
struct _xmlSchemaWildcardNs {
297
struct _xmlSchemaWildcardNs *next;/* the next constraint link ... */
298
const xmlChar *value;/* the value */
305
typedef struct _xmlSchemaWildcard xmlSchemaWildcard;
306
typedef xmlSchemaWildcard *xmlSchemaWildcardPtr;
307
struct _xmlSchemaWildcard {
308
xmlSchemaTypeType type; /* The kind of type */
309
const xmlChar *id; /* Deprecated; not used */
310
xmlSchemaAnnotPtr annot;
312
int minOccurs; /* Deprecated; not used */
313
int maxOccurs; /* Deprecated; not used */
315
int any; /* Indicates if the ns constraint is of ##any */
316
xmlSchemaWildcardNsPtr nsSet; /* The list of allowed namespaces */
317
xmlSchemaWildcardNsPtr negNsSet; /* The negated namespace */
322
* XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED:
324
* The attribute wildcard has been already builded.
326
#define XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED 1 << 0
328
* XML_SCHEMAS_ATTRGROUP_GLOBAL:
330
* The attribute wildcard has been already builded.
332
#define XML_SCHEMAS_ATTRGROUP_GLOBAL 1 << 1
334
* XML_SCHEMAS_ATTRGROUP_MARKED:
336
* Marks the attr group as marked; used for circular checks.
338
#define XML_SCHEMAS_ATTRGROUP_MARKED 1 << 2
341
* XML_SCHEMAS_ATTRGROUP_REDEFINED:
343
* The attr group was redefined.
345
#define XML_SCHEMAS_ATTRGROUP_REDEFINED 1 << 3
347
* XML_SCHEMAS_ATTRGROUP_HAS_REFS:
349
* Whether this attr. group contains attr. group references.
351
#define XML_SCHEMAS_ATTRGROUP_HAS_REFS 1 << 4
354
* An attribute group definition.
356
* xmlSchemaAttribute and xmlSchemaAttributeGroup start of structures
357
* must be kept similar
359
typedef struct _xmlSchemaAttributeGroup xmlSchemaAttributeGroup;
360
typedef xmlSchemaAttributeGroup *xmlSchemaAttributeGroupPtr;
361
struct _xmlSchemaAttributeGroup {
362
xmlSchemaTypeType type; /* The kind of type */
363
struct _xmlSchemaAttribute *next;/* the next attribute if in a group ... */
366
const xmlChar *ref; /* Deprecated; not used */
367
const xmlChar *refNs; /* Deprecated; not used */
368
xmlSchemaAnnotPtr annot;
370
xmlSchemaAttributePtr attributes; /* Deprecated; not used */
373
xmlSchemaWildcardPtr attributeWildcard;
374
const xmlChar *refPrefix; /* Deprecated; not used */
375
xmlSchemaAttributeGroupPtr refItem; /* Deprecated; not used */
376
const xmlChar *targetNamespace;
382
* Used to build a list of types (e.g. member types of
383
* simpleType with variety "union").
385
typedef struct _xmlSchemaTypeLink xmlSchemaTypeLink;
386
typedef xmlSchemaTypeLink *xmlSchemaTypeLinkPtr;
387
struct _xmlSchemaTypeLink {
388
struct _xmlSchemaTypeLink *next;/* the next type link ... */
389
xmlSchemaTypePtr type;/* the linked type */
393
* xmlSchemaFacetLink:
394
* Used to build a list of facets.
396
typedef struct _xmlSchemaFacetLink xmlSchemaFacetLink;
397
typedef xmlSchemaFacetLink *xmlSchemaFacetLinkPtr;
398
struct _xmlSchemaFacetLink {
399
struct _xmlSchemaFacetLink *next;/* the next facet link ... */
400
xmlSchemaFacetPtr facet;/* the linked facet */
404
* XML_SCHEMAS_TYPE_MIXED:
406
* the element content type is mixed
408
#define XML_SCHEMAS_TYPE_MIXED 1 << 0
410
* XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION:
412
* the simple or complex type has a derivation method of "extension".
414
#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION 1 << 1
416
* XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION:
418
* the simple or complex type has a derivation method of "restriction".
420
#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION 1 << 2
422
* XML_SCHEMAS_TYPE_GLOBAL:
426
#define XML_SCHEMAS_TYPE_GLOBAL 1 << 3
428
* XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD:
430
* the complexType owns an attribute wildcard, i.e.
431
* it can be freed by the complexType
433
#define XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD 1 << 4 /* Obsolete. */
435
* XML_SCHEMAS_TYPE_VARIETY_ABSENT:
437
* the simpleType has a variety of "absent".
438
* TODO: Actually not necessary :-/, since if
439
* none of the variety flags occur then it's
440
* automatically absent.
442
#define XML_SCHEMAS_TYPE_VARIETY_ABSENT 1 << 5
444
* XML_SCHEMAS_TYPE_VARIETY_LIST:
446
* the simpleType has a variety of "list".
448
#define XML_SCHEMAS_TYPE_VARIETY_LIST 1 << 6
450
* XML_SCHEMAS_TYPE_VARIETY_UNION:
452
* the simpleType has a variety of "union".
454
#define XML_SCHEMAS_TYPE_VARIETY_UNION 1 << 7
456
* XML_SCHEMAS_TYPE_VARIETY_ATOMIC:
458
* the simpleType has a variety of "union".
460
#define XML_SCHEMAS_TYPE_VARIETY_ATOMIC 1 << 8
462
* XML_SCHEMAS_TYPE_FINAL_EXTENSION:
464
* the complexType has a final of "extension".
466
#define XML_SCHEMAS_TYPE_FINAL_EXTENSION 1 << 9
468
* XML_SCHEMAS_TYPE_FINAL_RESTRICTION:
470
* the simpleType/complexType has a final of "restriction".
472
#define XML_SCHEMAS_TYPE_FINAL_RESTRICTION 1 << 10
474
* XML_SCHEMAS_TYPE_FINAL_LIST:
476
* the simpleType has a final of "list".
478
#define XML_SCHEMAS_TYPE_FINAL_LIST 1 << 11
480
* XML_SCHEMAS_TYPE_FINAL_UNION:
482
* the simpleType has a final of "union".
484
#define XML_SCHEMAS_TYPE_FINAL_UNION 1 << 12
486
* XML_SCHEMAS_TYPE_FINAL_DEFAULT:
488
* the simpleType has a final of "default".
490
#define XML_SCHEMAS_TYPE_FINAL_DEFAULT 1 << 13
492
* XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE:
494
* Marks the item as a builtin primitive.
496
#define XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE 1 << 14
498
* XML_SCHEMAS_TYPE_MARKED:
500
* Marks the item as marked; used for circular checks.
502
#define XML_SCHEMAS_TYPE_MARKED 1 << 16
504
* XML_SCHEMAS_TYPE_BLOCK_DEFAULT:
506
* the complexType did not specify 'block' so use the default of the
509
#define XML_SCHEMAS_TYPE_BLOCK_DEFAULT 1 << 17
511
* XML_SCHEMAS_TYPE_BLOCK_EXTENSION:
513
* the complexType has a 'block' of "extension".
515
#define XML_SCHEMAS_TYPE_BLOCK_EXTENSION 1 << 18
517
* XML_SCHEMAS_TYPE_BLOCK_RESTRICTION:
519
* the complexType has a 'block' of "restriction".
521
#define XML_SCHEMAS_TYPE_BLOCK_RESTRICTION 1 << 19
523
* XML_SCHEMAS_TYPE_ABSTRACT:
525
* the simple/complexType is abstract.
527
#define XML_SCHEMAS_TYPE_ABSTRACT 1 << 20
529
* XML_SCHEMAS_TYPE_FACETSNEEDVALUE:
531
* indicates if the facets need a computed value
533
#define XML_SCHEMAS_TYPE_FACETSNEEDVALUE 1 << 21
535
* XML_SCHEMAS_TYPE_INTERNAL_RESOLVED:
537
* indicates that the type was typefixed
539
#define XML_SCHEMAS_TYPE_INTERNAL_RESOLVED 1 << 22
541
* XML_SCHEMAS_TYPE_INTERNAL_INVALID:
543
* indicates that the type is invalid
545
#define XML_SCHEMAS_TYPE_INTERNAL_INVALID 1 << 23
547
* XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE:
549
* a whitespace-facet value of "preserve"
551
#define XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE 1 << 24
553
* XML_SCHEMAS_TYPE_WHITESPACE_REPLACE:
555
* a whitespace-facet value of "replace"
557
#define XML_SCHEMAS_TYPE_WHITESPACE_REPLACE 1 << 25
559
* XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE:
561
* a whitespace-facet value of "collapse"
563
#define XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE 1 << 26
565
* XML_SCHEMAS_TYPE_HAS_FACETS:
569
#define XML_SCHEMAS_TYPE_HAS_FACETS 1 << 27
571
* XML_SCHEMAS_TYPE_NORMVALUENEEDED:
573
* indicates if the facets (pattern) need a normalized value
575
#define XML_SCHEMAS_TYPE_NORMVALUENEEDED 1 << 28
578
* XML_SCHEMAS_TYPE_FIXUP_1:
580
* First stage of fixup was done.
582
#define XML_SCHEMAS_TYPE_FIXUP_1 1 << 29
585
* XML_SCHEMAS_TYPE_REDEFINED:
587
* The type was redefined.
589
#define XML_SCHEMAS_TYPE_REDEFINED 1 << 30
591
* XML_SCHEMAS_TYPE_REDEFINING:
593
* The type redefines an other type.
595
/* #define XML_SCHEMAS_TYPE_REDEFINING 1 << 31 */
600
* Schemas type definition.
602
struct _xmlSchemaType {
603
xmlSchemaTypeType type; /* The kind of type */
604
struct _xmlSchemaType *next; /* the next type if in a sequence ... */
606
const xmlChar *id ; /* Deprecated; not used */
607
const xmlChar *ref; /* Deprecated; not used */
608
const xmlChar *refNs; /* Deprecated; not used */
609
xmlSchemaAnnotPtr annot;
610
xmlSchemaTypePtr subtypes;
611
xmlSchemaAttributePtr attributes; /* Deprecated; not used */
613
int minOccurs; /* Deprecated; not used */
614
int maxOccurs; /* Deprecated; not used */
617
xmlSchemaContentType contentType;
618
const xmlChar *base; /* Base type's local name */
619
const xmlChar *baseNs; /* Base type's target namespace */
620
xmlSchemaTypePtr baseType; /* The base type component */
621
xmlSchemaFacetPtr facets; /* Local facets */
622
struct _xmlSchemaType *redef; /* Deprecated; not used */
623
int recurse; /* Obsolete */
624
xmlSchemaAttributeLinkPtr *attributeUses; /* Deprecated; not used */
625
xmlSchemaWildcardPtr attributeWildcard;
626
int builtInType; /* Type of built-in types. */
627
xmlSchemaTypeLinkPtr memberTypes; /* member-types if a union type. */
628
xmlSchemaFacetLinkPtr facetSet; /* All facets (incl. inherited) */
629
const xmlChar *refPrefix; /* Deprecated; not used */
630
xmlSchemaTypePtr contentTypeDef; /* Used for the simple content of complex types.
631
Could we use @subtypes for this? */
632
xmlRegexpPtr contModel; /* Holds the automaton of the content model */
633
const xmlChar *targetNamespace;
639
* An element definition.
641
* xmlSchemaType, xmlSchemaFacet and xmlSchemaElement start of
642
* structures must be kept similar
645
* XML_SCHEMAS_ELEM_NILLABLE:
647
* the element is nillable
649
#define XML_SCHEMAS_ELEM_NILLABLE 1 << 0
651
* XML_SCHEMAS_ELEM_GLOBAL:
653
* the element is global
655
#define XML_SCHEMAS_ELEM_GLOBAL 1 << 1
657
* XML_SCHEMAS_ELEM_DEFAULT:
659
* the element has a default value
661
#define XML_SCHEMAS_ELEM_DEFAULT 1 << 2
663
* XML_SCHEMAS_ELEM_FIXED:
665
* the element has a fixed value
667
#define XML_SCHEMAS_ELEM_FIXED 1 << 3
669
* XML_SCHEMAS_ELEM_ABSTRACT:
671
* the element is abstract
673
#define XML_SCHEMAS_ELEM_ABSTRACT 1 << 4
675
* XML_SCHEMAS_ELEM_TOPLEVEL:
677
* the element is top level
678
* obsolete: use XML_SCHEMAS_ELEM_GLOBAL instead
680
#define XML_SCHEMAS_ELEM_TOPLEVEL 1 << 5
682
* XML_SCHEMAS_ELEM_REF:
684
* the element is a reference to a type
686
#define XML_SCHEMAS_ELEM_REF 1 << 6
688
* XML_SCHEMAS_ELEM_NSDEFAULT:
690
* allow elements in no namespace
691
* Obsolete, not used anymore.
693
#define XML_SCHEMAS_ELEM_NSDEFAULT 1 << 7
695
* XML_SCHEMAS_ELEM_INTERNAL_RESOLVED:
697
* this is set when "type", "ref", "substitutionGroup"
698
* references have been resolved.
700
#define XML_SCHEMAS_ELEM_INTERNAL_RESOLVED 1 << 8
702
* XML_SCHEMAS_ELEM_CIRCULAR:
704
* a helper flag for the search of circular references.
706
#define XML_SCHEMAS_ELEM_CIRCULAR 1 << 9
708
* XML_SCHEMAS_ELEM_BLOCK_ABSENT:
710
* the "block" attribute is absent
712
#define XML_SCHEMAS_ELEM_BLOCK_ABSENT 1 << 10
714
* XML_SCHEMAS_ELEM_BLOCK_EXTENSION:
716
* disallowed substitutions are absent
718
#define XML_SCHEMAS_ELEM_BLOCK_EXTENSION 1 << 11
720
* XML_SCHEMAS_ELEM_BLOCK_RESTRICTION:
722
* disallowed substitutions: "restriction"
724
#define XML_SCHEMAS_ELEM_BLOCK_RESTRICTION 1 << 12
726
* XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION:
728
* disallowed substitutions: "substituion"
730
#define XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION 1 << 13
732
* XML_SCHEMAS_ELEM_FINAL_ABSENT:
734
* substitution group exclusions are absent
736
#define XML_SCHEMAS_ELEM_FINAL_ABSENT 1 << 14
738
* XML_SCHEMAS_ELEM_FINAL_EXTENSION:
740
* substitution group exclusions: "extension"
742
#define XML_SCHEMAS_ELEM_FINAL_EXTENSION 1 << 15
744
* XML_SCHEMAS_ELEM_FINAL_RESTRICTION:
746
* substitution group exclusions: "restriction"
748
#define XML_SCHEMAS_ELEM_FINAL_RESTRICTION 1 << 16
750
* XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD:
752
* the declaration is a substitution group head
754
#define XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD 1 << 17
756
* XML_SCHEMAS_ELEM_INTERNAL_CHECKED:
758
* this is set when the elem decl has been checked against
761
#define XML_SCHEMAS_ELEM_INTERNAL_CHECKED 1 << 18
763
typedef struct _xmlSchemaElement xmlSchemaElement;
764
typedef xmlSchemaElement *xmlSchemaElementPtr;
765
struct _xmlSchemaElement {
766
xmlSchemaTypeType type; /* The kind of type */
767
struct _xmlSchemaType *next; /* Not used? */
769
const xmlChar *id; /* Deprecated; not used */
770
const xmlChar *ref; /* Deprecated; not used */
771
const xmlChar *refNs; /* Deprecated; not used */
772
xmlSchemaAnnotPtr annot;
773
xmlSchemaTypePtr subtypes; /* the type definition */
774
xmlSchemaAttributePtr attributes;
776
int minOccurs; /* Deprecated; not used */
777
int maxOccurs; /* Deprecated; not used */
780
const xmlChar *targetNamespace;
781
const xmlChar *namedType;
782
const xmlChar *namedTypeNs;
783
const xmlChar *substGroup;
784
const xmlChar *substGroupNs;
785
const xmlChar *scope;
786
const xmlChar *value; /* The original value of the value constraint. */
787
struct _xmlSchemaElement *refDecl; /* This will now be used for the
788
substitution group affiliation */
789
xmlRegexpPtr contModel; /* Obsolete for WXS, maybe used for RelaxNG */
790
xmlSchemaContentType contentType;
791
const xmlChar *refPrefix; /* Deprecated; not used */
792
xmlSchemaValPtr defVal; /* The compiled value contraint. */
793
void *idcs; /* The identity-constraint defs */
797
* XML_SCHEMAS_FACET_UNKNOWN:
799
* unknown facet handling
801
#define XML_SCHEMAS_FACET_UNKNOWN 0
803
* XML_SCHEMAS_FACET_PRESERVE:
805
* preserve the type of the facet
807
#define XML_SCHEMAS_FACET_PRESERVE 1
809
* XML_SCHEMAS_FACET_REPLACE:
811
* replace the type of the facet
813
#define XML_SCHEMAS_FACET_REPLACE 2
815
* XML_SCHEMAS_FACET_COLLAPSE:
817
* collapse the types of the facet
819
#define XML_SCHEMAS_FACET_COLLAPSE 3
821
* A facet definition.
823
struct _xmlSchemaFacet {
824
xmlSchemaTypeType type; /* The kind of type */
825
struct _xmlSchemaFacet *next;/* the next type if in a sequence ... */
826
const xmlChar *value; /* The original value */
827
const xmlChar *id; /* Obsolete */
828
xmlSchemaAnnotPtr annot;
830
int fixed; /* XML_SCHEMAS_FACET_PRESERVE, etc. */
832
xmlSchemaValPtr val; /* The compiled value */
833
xmlRegexpPtr regexp; /* The regex for patterns */
837
* A notation definition.
839
typedef struct _xmlSchemaNotation xmlSchemaNotation;
840
typedef xmlSchemaNotation *xmlSchemaNotationPtr;
841
struct _xmlSchemaNotation {
842
xmlSchemaTypeType type; /* The kind of type */
844
xmlSchemaAnnotPtr annot;
845
const xmlChar *identifier;
846
const xmlChar *targetNamespace;
850
* TODO: Actually all those flags used for the schema should sit
851
* on the schema parser context, since they are used only
852
* during parsing an XML schema document, and not available
853
* on the component level as per spec.
856
* XML_SCHEMAS_QUALIF_ELEM:
858
* Reflects elementFormDefault == qualified in
859
* an XML schema document.
861
#define XML_SCHEMAS_QUALIF_ELEM 1 << 0
863
* XML_SCHEMAS_QUALIF_ATTR:
865
* Reflects attributeFormDefault == qualified in
866
* an XML schema document.
868
#define XML_SCHEMAS_QUALIF_ATTR 1 << 1
870
* XML_SCHEMAS_FINAL_DEFAULT_EXTENSION:
872
* the schema has "extension" in the set of finalDefault.
874
#define XML_SCHEMAS_FINAL_DEFAULT_EXTENSION 1 << 2
876
* XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION:
878
* the schema has "restriction" in the set of finalDefault.
880
#define XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION 1 << 3
882
* XML_SCHEMAS_FINAL_DEFAULT_LIST:
884
* the cshema has "list" in the set of finalDefault.
886
#define XML_SCHEMAS_FINAL_DEFAULT_LIST 1 << 4
888
* XML_SCHEMAS_FINAL_DEFAULT_UNION:
890
* the schema has "union" in the set of finalDefault.
892
#define XML_SCHEMAS_FINAL_DEFAULT_UNION 1 << 5
894
* XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION:
896
* the schema has "extension" in the set of blockDefault.
898
#define XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION 1 << 6
900
* XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION:
902
* the schema has "restriction" in the set of blockDefault.
904
#define XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION 1 << 7
906
* XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION:
908
* the schema has "substitution" in the set of blockDefault.
910
#define XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION 1 << 8
912
* XML_SCHEMAS_INCLUDING_CONVERT_NS:
914
* the schema is currently including an other schema with
915
* no target namespace.
917
#define XML_SCHEMAS_INCLUDING_CONVERT_NS 1 << 9
921
* A Schemas definition
924
const xmlChar *name; /* schema name */
925
const xmlChar *targetNamespace; /* the target namespace */
926
const xmlChar *version;
927
const xmlChar *id; /* Obsolete */
929
xmlSchemaAnnotPtr annot;
932
xmlHashTablePtr typeDecl;
933
xmlHashTablePtr attrDecl;
934
xmlHashTablePtr attrgrpDecl;
935
xmlHashTablePtr elemDecl;
936
xmlHashTablePtr notaDecl;
938
xmlHashTablePtr schemasImports;
940
void *_private; /* unused by the library for users or bindings */
941
xmlHashTablePtr groupDecl;
943
void *includes; /* the includes, this is opaque for now */
944
int preserve; /* whether to free the document */
945
int counter; /* used to give ononymous components unique names */
946
xmlHashTablePtr idcDef; /* All identity-constraint defs. */
947
void *volatiles; /* Obsolete */
950
XMLPUBFUN void XMLCALL xmlSchemaFreeType (xmlSchemaTypePtr type);
951
XMLPUBFUN void XMLCALL xmlSchemaFreeWildcard(xmlSchemaWildcardPtr wildcard);
957
#endif /* LIBXML_SCHEMAS_ENABLED */
958
#endif /* __XML_SCHEMA_INTERNALS_H__ */