blob: eb1f426f7566cf0045897220e0b523b940c25eff [file] [log] [blame]
Daniel Veillard4255d502002-04-16 15:50:10 +00001/*
Daniel Veillardbe586972003-11-18 20:56:51 +00002 * Summary: internal interfaces for XML Schemas
3 * Description: internal interfaces for the XML Schemas handling
4 * and schema validity checking
Daniel Veillard4255d502002-04-16 15:50:10 +00005 *
Daniel Veillardbe586972003-11-18 20:56:51 +00006 * Copy: See Copyright for the status of this software.
Daniel Veillard4255d502002-04-16 15:50:10 +00007 *
Daniel Veillardbe586972003-11-18 20:56:51 +00008 * Author: Daniel Veillard
Daniel Veillard4255d502002-04-16 15:50:10 +00009 */
10
11
12#ifndef __XML_SCHEMA_INTERNALS_H__
13#define __XML_SCHEMA_INTERNALS_H__
14
Daniel Veillard4255d502002-04-16 15:50:10 +000015#include <libxml/xmlversion.h>
Igor Zlatkovic7ae91bc2002-11-08 17:18:52 +000016
Daniel Veillard4255d502002-04-16 15:50:10 +000017#ifdef LIBXML_SCHEMAS_ENABLED
18
19#include <libxml/xmlregexp.h>
Daniel Veillard8326e732003-01-07 00:19:07 +000020#include <libxml/hash.h>
Daniel Veillardbe9c6322003-11-22 20:37:51 +000021#include <libxml/dict.h>
Daniel Veillard4255d502002-04-16 15:50:10 +000022
23#ifdef __cplusplus
24extern "C" {
25#endif
26
Daniel Veillard01fa6152004-06-29 17:04:39 +000027typedef enum {
28 XML_SCHEMAS_UNKNOWN = 0,
29 XML_SCHEMAS_STRING,
30 XML_SCHEMAS_NORMSTRING,
31 XML_SCHEMAS_DECIMAL,
32 XML_SCHEMAS_TIME,
33 XML_SCHEMAS_GDAY,
34 XML_SCHEMAS_GMONTH,
35 XML_SCHEMAS_GMONTHDAY,
36 XML_SCHEMAS_GYEAR,
37 XML_SCHEMAS_GYEARMONTH,
38 XML_SCHEMAS_DATE,
39 XML_SCHEMAS_DATETIME,
40 XML_SCHEMAS_DURATION,
41 XML_SCHEMAS_FLOAT,
42 XML_SCHEMAS_DOUBLE,
43 XML_SCHEMAS_BOOLEAN,
44 XML_SCHEMAS_TOKEN,
45 XML_SCHEMAS_LANGUAGE,
46 XML_SCHEMAS_NMTOKEN,
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +000047 XML_SCHEMAS_NMTOKENS,
Daniel Veillard01fa6152004-06-29 17:04:39 +000048 XML_SCHEMAS_NAME,
49 XML_SCHEMAS_QNAME,
50 XML_SCHEMAS_NCNAME,
51 XML_SCHEMAS_ID,
52 XML_SCHEMAS_IDREF,
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +000053 XML_SCHEMAS_IDREFS,
Daniel Veillard01fa6152004-06-29 17:04:39 +000054 XML_SCHEMAS_ENTITY,
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +000055 XML_SCHEMAS_ENTITIES,
Daniel Veillard01fa6152004-06-29 17:04:39 +000056 XML_SCHEMAS_NOTATION,
57 XML_SCHEMAS_ANYURI,
58 XML_SCHEMAS_INTEGER,
59 XML_SCHEMAS_NPINTEGER,
60 XML_SCHEMAS_NINTEGER,
61 XML_SCHEMAS_NNINTEGER,
62 XML_SCHEMAS_PINTEGER,
63 XML_SCHEMAS_INT,
64 XML_SCHEMAS_UINT,
65 XML_SCHEMAS_LONG,
66 XML_SCHEMAS_ULONG,
67 XML_SCHEMAS_SHORT,
68 XML_SCHEMAS_USHORT,
69 XML_SCHEMAS_BYTE,
70 XML_SCHEMAS_UBYTE,
71 XML_SCHEMAS_HEXBINARY,
72 XML_SCHEMAS_BASE64BINARY,
73 XML_SCHEMAS_ANYTYPE,
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +000074 XML_SCHEMAS_ANYSIMPLETYPE
Daniel Veillard01fa6152004-06-29 17:04:39 +000075} xmlSchemaValType;
Daniel Veillard4255d502002-04-16 15:50:10 +000076
77/*
78 * XML Schemas defines multiple type of types.
79 */
80typedef enum {
Daniel Veillard01fa6152004-06-29 17:04:39 +000081 XML_SCHEMA_TYPE_BASIC = 1, /* A built-in datatype */
Daniel Veillard4255d502002-04-16 15:50:10 +000082 XML_SCHEMA_TYPE_ANY,
83 XML_SCHEMA_TYPE_FACET,
84 XML_SCHEMA_TYPE_SIMPLE,
85 XML_SCHEMA_TYPE_COMPLEX,
Kasimier T. Buchcik4efd90d2005-06-09 10:32:53 +000086 XML_SCHEMA_TYPE_SEQUENCE = 6,
Daniel Veillard4255d502002-04-16 15:50:10 +000087 XML_SCHEMA_TYPE_CHOICE,
88 XML_SCHEMA_TYPE_ALL,
89 XML_SCHEMA_TYPE_SIMPLE_CONTENT,
90 XML_SCHEMA_TYPE_COMPLEX_CONTENT,
91 XML_SCHEMA_TYPE_UR,
92 XML_SCHEMA_TYPE_RESTRICTION,
93 XML_SCHEMA_TYPE_EXTENSION,
94 XML_SCHEMA_TYPE_ELEMENT,
95 XML_SCHEMA_TYPE_ATTRIBUTE,
Daniel Veillard13e04c62002-04-23 17:51:29 +000096 XML_SCHEMA_TYPE_ATTRIBUTEGROUP,
Daniel Veillard4255d502002-04-16 15:50:10 +000097 XML_SCHEMA_TYPE_GROUP,
98 XML_SCHEMA_TYPE_NOTATION,
99 XML_SCHEMA_TYPE_LIST,
100 XML_SCHEMA_TYPE_UNION,
William M. Bracke7091952004-05-11 15:09:58 +0000101 XML_SCHEMA_TYPE_ANY_ATTRIBUTE,
Kasimier T. Buchcike8a550b2005-01-27 12:49:31 +0000102 XML_SCHEMA_TYPE_IDC_UNIQUE,
103 XML_SCHEMA_TYPE_IDC_KEY,
104 XML_SCHEMA_TYPE_IDC_KEYREF,
Kasimier T. Buchcik4efd90d2005-06-09 10:32:53 +0000105 XML_SCHEMA_TYPE_PARTICLE = 25,
Daniel Veillard4255d502002-04-16 15:50:10 +0000106 XML_SCHEMA_FACET_MININCLUSIVE = 1000,
107 XML_SCHEMA_FACET_MINEXCLUSIVE,
108 XML_SCHEMA_FACET_MAXINCLUSIVE,
109 XML_SCHEMA_FACET_MAXEXCLUSIVE,
110 XML_SCHEMA_FACET_TOTALDIGITS,
111 XML_SCHEMA_FACET_FRACTIONDIGITS,
112 XML_SCHEMA_FACET_PATTERN,
113 XML_SCHEMA_FACET_ENUMERATION,
114 XML_SCHEMA_FACET_WHITESPACE,
115 XML_SCHEMA_FACET_LENGTH,
116 XML_SCHEMA_FACET_MAXLENGTH,
Kasimier T. Buchcik256401b2005-04-01 15:36:42 +0000117 XML_SCHEMA_FACET_MINLENGTH,
118 XML_SCHEMA_EXTRA_QNAMEREF = 2000
Daniel Veillard4255d502002-04-16 15:50:10 +0000119} xmlSchemaTypeType;
120
121typedef enum {
122 XML_SCHEMA_CONTENT_UNKNOWN = 0,
123 XML_SCHEMA_CONTENT_EMPTY = 1,
124 XML_SCHEMA_CONTENT_ELEMENTS,
125 XML_SCHEMA_CONTENT_MIXED,
126 XML_SCHEMA_CONTENT_SIMPLE,
Daniel Veillard01fa6152004-06-29 17:04:39 +0000127 XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS, /* obsolete, not used */
Daniel Veillard88c58912002-04-23 07:12:20 +0000128 XML_SCHEMA_CONTENT_BASIC,
129 XML_SCHEMA_CONTENT_ANY
Daniel Veillard4255d502002-04-16 15:50:10 +0000130} xmlSchemaContentType;
131
132typedef struct _xmlSchemaVal xmlSchemaVal;
133typedef xmlSchemaVal *xmlSchemaValPtr;
134
135typedef struct _xmlSchemaType xmlSchemaType;
136typedef xmlSchemaType *xmlSchemaTypePtr;
137
138typedef struct _xmlSchemaFacet xmlSchemaFacet;
139typedef xmlSchemaFacet *xmlSchemaFacetPtr;
140
141/**
142 * Annotation
143 */
144typedef struct _xmlSchemaAnnot xmlSchemaAnnot;
145typedef xmlSchemaAnnot *xmlSchemaAnnotPtr;
146struct _xmlSchemaAnnot {
147 struct _xmlSchemaAnnot *next;
148 xmlNodePtr content; /* the annotation */
149};
150
151/**
Daniel Veillard1e906612003-12-05 14:57:46 +0000152 * XML_SCHEMAS_ANYATTR_SKIP:
153 *
154 * Skip unknown attribute from validation
Daniel Veillard01fa6152004-06-29 17:04:39 +0000155 * Obsolete, not used anymore.
Daniel Veillard4255d502002-04-16 15:50:10 +0000156 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000157#define XML_SCHEMAS_ANYATTR_SKIP 1
Daniel Veillard1e906612003-12-05 14:57:46 +0000158/**
159 * XML_SCHEMAS_ANYATTR_LAX:
160 *
161 * Ignore validation non definition on attributes
Daniel Veillard01fa6152004-06-29 17:04:39 +0000162 * Obsolete, not used anymore.
Daniel Veillard1e906612003-12-05 14:57:46 +0000163 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000164#define XML_SCHEMAS_ANYATTR_LAX 2
Daniel Veillard1e906612003-12-05 14:57:46 +0000165/**
166 * XML_SCHEMAS_ANYATTR_STRICT:
167 *
168 * Apply strict validation rules on attributes
Daniel Veillard01fa6152004-06-29 17:04:39 +0000169 * Obsolete, not used anymore.
Daniel Veillard1e906612003-12-05 14:57:46 +0000170 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000171#define XML_SCHEMAS_ANYATTR_STRICT 3
Daniel Veillard3646d642004-06-02 19:19:14 +0000172/**
173 * XML_SCHEMAS_ANY_SKIP:
174 *
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000175 * Skip unknown attribute from validation
Daniel Veillard3646d642004-06-02 19:19:14 +0000176 */
177#define XML_SCHEMAS_ANY_SKIP 1
178/**
179 * XML_SCHEMAS_ANY_LAX:
180 *
Daniel Veillard01fa6152004-06-29 17:04:39 +0000181 * Used by wildcards.
182 * Validate if type found, don't worry if not found
Daniel Veillard3646d642004-06-02 19:19:14 +0000183 */
184#define XML_SCHEMAS_ANY_LAX 2
185/**
186 * XML_SCHEMAS_ANY_STRICT:
187 *
Daniel Veillard01fa6152004-06-29 17:04:39 +0000188 * Used by wildcards.
189 * Apply strict validation rules
Daniel Veillard3646d642004-06-02 19:19:14 +0000190 */
191#define XML_SCHEMAS_ANY_STRICT 3
Daniel Veillardbe9c6322003-11-22 20:37:51 +0000192/**
Daniel Veillardc85d0fe2004-04-16 16:46:51 +0000193 * XML_SCHEMAS_ATTR_USE_PROHIBITED:
194 *
Daniel Veillard01fa6152004-06-29 17:04:39 +0000195 * Used by wildcards.
Daniel Veillardc85d0fe2004-04-16 16:46:51 +0000196 * The attribute is prohibited.
197 */
198#define XML_SCHEMAS_ATTR_USE_PROHIBITED 0
Daniel Veillardc85d0fe2004-04-16 16:46:51 +0000199/**
200 * XML_SCHEMAS_ATTR_USE_REQUIRED:
201 *
202 * The attribute is required.
203 */
204#define XML_SCHEMAS_ATTR_USE_REQUIRED 1
Daniel Veillardc85d0fe2004-04-16 16:46:51 +0000205/**
206 * XML_SCHEMAS_ATTR_USE_OPTIONAL:
207 *
208 * The attribute is optional.
209 */
210#define XML_SCHEMAS_ATTR_USE_OPTIONAL 2
Daniel Veillard3646d642004-06-02 19:19:14 +0000211/**
William M. Brack21e4ef22005-01-02 09:53:13 +0000212 * XML_SCHEMAS_ATTR_GLOBAL:
Daniel Veillard3646d642004-06-02 19:19:14 +0000213 *
214 * allow elements in no namespace
215 */
216#define XML_SCHEMAS_ATTR_GLOBAL 1 << 0
Daniel Veillardc85d0fe2004-04-16 16:46:51 +0000217/**
Daniel Veillardbe9c6322003-11-22 20:37:51 +0000218 * XML_SCHEMAS_ATTR_NSDEFAULT:
219 *
220 * allow elements in no namespace
221 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000222#define XML_SCHEMAS_ATTR_NSDEFAULT 1 << 7
Daniel Veillardc0826a72004-08-10 14:17:33 +0000223/**
Kasimier T. Buchcik87876402004-09-29 13:29:03 +0000224 * XML_SCHEMAS_ATTR_INTERNAL_RESOLVED:
Daniel Veillardc0826a72004-08-10 14:17:33 +0000225 *
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000226 * this is set when the "type" and "ref" references
Daniel Veillardc0826a72004-08-10 14:17:33 +0000227 * have been resolved.
228 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000229#define XML_SCHEMAS_ATTR_INTERNAL_RESOLVED 1 << 8
Daniel Veillardc0826a72004-08-10 14:17:33 +0000230/**
231 * XML_SCHEMAS_ATTR_FIXED:
232 *
233 * the attribute has a fixed value
234 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000235#define XML_SCHEMAS_ATTR_FIXED 1 << 9
Daniel Veillardbe9c6322003-11-22 20:37:51 +0000236
Daniel Veillard1e906612003-12-05 14:57:46 +0000237/**
238 * xmlSchemaAttribute:
239 * An attribute definition.
240 */
241
Daniel Veillard4255d502002-04-16 15:50:10 +0000242typedef struct _xmlSchemaAttribute xmlSchemaAttribute;
243typedef xmlSchemaAttribute *xmlSchemaAttributePtr;
244struct _xmlSchemaAttribute {
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000245 xmlSchemaTypeType type; /* The kind of type */
246 struct _xmlSchemaAttribute *next;/* the next attribute if in a group ... */
Daniel Veillardc0826a72004-08-10 14:17:33 +0000247 const xmlChar *name; /* name of the declaration or empty if particle */
Daniel Veillardbe9c6322003-11-22 20:37:51 +0000248 const xmlChar *id;
Daniel Veillardc0826a72004-08-10 14:17:33 +0000249 const xmlChar *ref; /* the local name of the attribute decl. if a particle */
250 const xmlChar *refNs; /* the ns URI of the attribute decl. if a particle */
251 const xmlChar *typeName; /* the local name of the type definition */
252 const xmlChar *typeNs; /* the ns URI of the type definition */
Daniel Veillard4255d502002-04-16 15:50:10 +0000253 xmlSchemaAnnotPtr annot;
254
Daniel Veillardc0826a72004-08-10 14:17:33 +0000255 xmlSchemaTypePtr base; /* obsolete, not used */
Daniel Veillard4255d502002-04-16 15:50:10 +0000256 int occurs;
Daniel Veillardbe9c6322003-11-22 20:37:51 +0000257 const xmlChar *defValue;
Daniel Veillardc0826a72004-08-10 14:17:33 +0000258 xmlSchemaTypePtr subtypes; /* the type definition */
Daniel Veillard75bb3bb2003-05-12 15:25:56 +0000259 xmlNodePtr node;
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000260 const xmlChar *targetNamespace;
Daniel Veillardbe9c6322003-11-22 20:37:51 +0000261 int flags;
Daniel Veillardc0826a72004-08-10 14:17:33 +0000262 const xmlChar *refPrefix;
Kasimier T. Buchcik87876402004-09-29 13:29:03 +0000263 xmlSchemaValPtr defVal;
264 xmlSchemaAttributePtr refDecl;
Daniel Veillard4255d502002-04-16 15:50:10 +0000265};
266
267/**
Daniel Veillard3646d642004-06-02 19:19:14 +0000268 * xmlSchemaAttributeLink:
269 * Used to build a list of attribute uses on complexType definitions.
270 */
271typedef struct _xmlSchemaAttributeLink xmlSchemaAttributeLink;
272typedef xmlSchemaAttributeLink *xmlSchemaAttributeLinkPtr;
273struct _xmlSchemaAttributeLink {
274 struct _xmlSchemaAttributeLink *next;/* the next attribute link ... */
275 struct _xmlSchemaAttribute *attr;/* the linked attribute */
276};
277
278/**
279 * XML_SCHEMAS_WILDCARD_COMPLETE:
280 *
281 * If the wildcard is complete.
282 */
283#define XML_SCHEMAS_WILDCARD_COMPLETE 1 << 0
284
285/**
286 * xmlSchemaCharValueLink:
287 * Used to build a list of namespaces on wildcards.
288 */
289typedef struct _xmlSchemaWildcardNs xmlSchemaWildcardNs;
290typedef xmlSchemaWildcardNs *xmlSchemaWildcardNsPtr;
291struct _xmlSchemaWildcardNs {
292 struct _xmlSchemaWildcardNs *next;/* the next constraint link ... */
293 const xmlChar *value;/* the value */
294};
295
296/**
297 * xmlSchemaWildcard.
298 * A wildcard.
299 */
300typedef struct _xmlSchemaWildcard xmlSchemaWildcard;
301typedef xmlSchemaWildcard *xmlSchemaWildcardPtr;
302struct _xmlSchemaWildcard {
303 xmlSchemaTypeType type; /* The kind of type */
304 const xmlChar *id;
305 xmlSchemaAnnotPtr annot;
306 xmlNodePtr node;
307 int minOccurs;
308 int maxOccurs;
309 int processContents;
310 int any; /* Indicates if the ns constraint is of ##any */
311 xmlSchemaWildcardNsPtr nsSet; /* The list of allowed namespaces */
312 xmlSchemaWildcardNsPtr negNsSet; /* The negated namespace */
313 int flags;
314};
315
316/**
317 * XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED:
318 *
319 * The attribute wildcard has been already builded.
320 */
321#define XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED 1 << 0
322/**
323 * XML_SCHEMAS_ATTRGROUP_GLOBAL:
324 *
325 * The attribute wildcard has been already builded.
326 */
327#define XML_SCHEMAS_ATTRGROUP_GLOBAL 1 << 1
Kasimier T. Buchcik383434b2004-09-03 18:55:35 +0000328/**
329 * XML_SCHEMAS_ATTRGROUP_MARKED:
330 *
331 * Marks the attr group as marked; used for circular checks.
332 */
333#define XML_SCHEMAS_ATTRGROUP_MARKED 1 << 2
Daniel Veillard3646d642004-06-02 19:19:14 +0000334
335/**
Daniel Veillard4255d502002-04-16 15:50:10 +0000336 * An attribute group definition.
337 *
338 * xmlSchemaAttribute and xmlSchemaAttributeGroup start of structures
339 * must be kept similar
340 */
341typedef struct _xmlSchemaAttributeGroup xmlSchemaAttributeGroup;
342typedef xmlSchemaAttributeGroup *xmlSchemaAttributeGroupPtr;
343struct _xmlSchemaAttributeGroup {
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000344 xmlSchemaTypeType type; /* The kind of type */
Daniel Veillard4255d502002-04-16 15:50:10 +0000345 struct _xmlSchemaAttribute *next;/* the next attribute if in a group ... */
Daniel Veillardbe9c6322003-11-22 20:37:51 +0000346 const xmlChar *name;
347 const xmlChar *id;
348 const xmlChar *ref;
349 const xmlChar *refNs;
Daniel Veillard4255d502002-04-16 15:50:10 +0000350 xmlSchemaAnnotPtr annot;
351
352 xmlSchemaAttributePtr attributes;
Daniel Veillard75bb3bb2003-05-12 15:25:56 +0000353 xmlNodePtr node;
Daniel Veillard3646d642004-06-02 19:19:14 +0000354 int flags;
355 xmlSchemaWildcardPtr attributeWildcard;
Daniel Veillardc0826a72004-08-10 14:17:33 +0000356 const xmlChar *refPrefix;
Kasimier T. Buchcik383434b2004-09-03 18:55:35 +0000357 xmlSchemaAttributeGroupPtr refItem; /* The referenced attribute group */
Kasimier T. Buchcik31113c72005-01-13 16:57:20 +0000358 const xmlChar *targetNamespace;
Daniel Veillard4255d502002-04-16 15:50:10 +0000359};
360
Daniel Veillard01fa6152004-06-29 17:04:39 +0000361/**
362 * xmlSchemaTypeLink:
363 * Used to build a list of types (e.g. member types of
364 * simpleType with variety "union").
365 */
366typedef struct _xmlSchemaTypeLink xmlSchemaTypeLink;
367typedef xmlSchemaTypeLink *xmlSchemaTypeLinkPtr;
368struct _xmlSchemaTypeLink {
369 struct _xmlSchemaTypeLink *next;/* the next type link ... */
370 xmlSchemaTypePtr type;/* the linked type*/
371};
372
373/**
374 * xmlSchemaFacetLink:
375 * Used to build a list of facets.
376 */
377typedef struct _xmlSchemaFacetLink xmlSchemaFacetLink;
378typedef xmlSchemaFacetLink *xmlSchemaFacetLinkPtr;
379struct _xmlSchemaFacetLink {
380 struct _xmlSchemaFacetLink *next;/* the next facet link ... */
381 xmlSchemaFacetPtr facet;/* the linked facet */
382};
Daniel Veillard4255d502002-04-16 15:50:10 +0000383
384/**
Daniel Veillarda9b66d02002-12-11 14:23:49 +0000385 * XML_SCHEMAS_TYPE_MIXED:
386 *
387 * the element content type is mixed
Daniel Veillard4255d502002-04-16 15:50:10 +0000388 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000389#define XML_SCHEMAS_TYPE_MIXED 1 << 0
Daniel Veillard3646d642004-06-02 19:19:14 +0000390/**
391 * XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION:
392 *
393 * the simple or complex type has a derivation method of "extension".
394 */
395#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION 1 << 1
396/**
397 * XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION:
398 *
399 * the simple or complex type has a derivation method of "restriction".
400 */
401#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION 1 << 2
402/**
403 * XML_SCHEMAS_TYPE_GLOBAL:
404 *
405 * the type is global
406 */
407#define XML_SCHEMAS_TYPE_GLOBAL 1 << 3
408/**
409 * XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD:
410 *
411 * the complexType owns an attribute wildcard, i.e.
412 * it can be freed by the complexType
413 */
Kasimier T. Buchcik256401b2005-04-01 15:36:42 +0000414#define XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD 1 << 4 /* Obsolete. */
Daniel Veillard01fa6152004-06-29 17:04:39 +0000415/**
416 * XML_SCHEMAS_TYPE_VARIETY_ABSENT:
417 *
418 * the simpleType has a variety of "absent".
419 */
420#define XML_SCHEMAS_TYPE_VARIETY_ABSENT 1 << 5
421/**
422 * XML_SCHEMAS_TYPE_VARIETY_LIST:
423 *
424 * the simpleType has a variety of "list".
425 */
426#define XML_SCHEMAS_TYPE_VARIETY_LIST 1 << 6
427/**
428 * XML_SCHEMAS_TYPE_VARIETY_UNION:
429 *
430 * the simpleType has a variety of "union".
431 */
432#define XML_SCHEMAS_TYPE_VARIETY_UNION 1 << 7
433/**
434 * XML_SCHEMAS_TYPE_VARIETY_ATOMIC:
435 *
436 * the simpleType has a variety of "union".
437 */
438#define XML_SCHEMAS_TYPE_VARIETY_ATOMIC 1 << 8
439/**
440 * XML_SCHEMAS_TYPE_FINAL_EXTENSION:
441 *
442 * the complexType has a final of "extension".
443 */
444#define XML_SCHEMAS_TYPE_FINAL_EXTENSION 1 << 9
445/**
446 * XML_SCHEMAS_TYPE_FINAL_RESTRICTION:
447 *
448 * the simpleType/complexType has a final of "restriction".
449 */
450#define XML_SCHEMAS_TYPE_FINAL_RESTRICTION 1 << 10
451/**
452 * XML_SCHEMAS_TYPE_FINAL_LIST:
453 *
454 * the simpleType has a final of "list".
455 */
456#define XML_SCHEMAS_TYPE_FINAL_LIST 1 << 11
457/**
458 * XML_SCHEMAS_TYPE_FINAL_UNION:
459 *
460 * the simpleType has a final of "union".
461 */
462#define XML_SCHEMAS_TYPE_FINAL_UNION 1 << 12
463/**
William M. Brack21e4ef22005-01-02 09:53:13 +0000464 * XML_SCHEMAS_TYPE_FINAL_DEFAULT:
Daniel Veillard01fa6152004-06-29 17:04:39 +0000465 *
William M. Brack21e4ef22005-01-02 09:53:13 +0000466 * the simpleType has a final of "default".
Daniel Veillard01fa6152004-06-29 17:04:39 +0000467 */
468#define XML_SCHEMAS_TYPE_FINAL_DEFAULT 1 << 13
469/**
William M. Brack21e4ef22005-01-02 09:53:13 +0000470 * XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE:
Daniel Veillard01fa6152004-06-29 17:04:39 +0000471 *
William M. Brack21e4ef22005-01-02 09:53:13 +0000472 * Marks the item as a builtin primitive.
Daniel Veillard01fa6152004-06-29 17:04:39 +0000473 */
474#define XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE 1 << 14
Kasimier T. Buchcik383434b2004-09-03 18:55:35 +0000475/**
William M. Brack21e4ef22005-01-02 09:53:13 +0000476 * XML_SCHEMAS_TYPE_MARKED:
Kasimier T. Buchcik383434b2004-09-03 18:55:35 +0000477 *
478 * Marks the item as marked; used for circular checks.
479 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000480#define XML_SCHEMAS_TYPE_MARKED 1 << 16
Kasimier T. Buchcik87876402004-09-29 13:29:03 +0000481/**
482 * XML_SCHEMAS_TYPE_BLOCK_DEFAULT:
483 *
484 * the complexType did not specify 'block' so use the default of the
485 * <schema> item.
486 */
487#define XML_SCHEMAS_TYPE_BLOCK_DEFAULT 1 << 17
488/**
489 * XML_SCHEMAS_TYPE_BLOCK_EXTENSION:
490 *
491 * the complexType has a 'block' of "extension".
492 */
493#define XML_SCHEMAS_TYPE_BLOCK_EXTENSION 1 << 18
494/**
William M. Brack21e4ef22005-01-02 09:53:13 +0000495 * XML_SCHEMAS_TYPE_BLOCK_RESTRICTION:
Kasimier T. Buchcik87876402004-09-29 13:29:03 +0000496 *
497 * the complexType has a 'block' of "restriction".
498 */
499#define XML_SCHEMAS_TYPE_BLOCK_RESTRICTION 1 << 19
500/**
501 * XML_SCHEMAS_TYPE_ABSTRACT:
502 *
503 * the simple/complexType is abstract.
504 */
505#define XML_SCHEMAS_TYPE_ABSTRACT 1 << 20
Kasimier T. Buchcike8a550b2005-01-27 12:49:31 +0000506/**
507 * XML_SCHEMAS_TYPE_FACETSNEEDVALUE:
508 *
509 * indicates if the facets need a computed value
510 */
511#define XML_SCHEMAS_TYPE_FACETSNEEDVALUE 1 << 21
Kasimier T. Buchcik256401b2005-04-01 15:36:42 +0000512/**
513 * XML_SCHEMAS_TYPE_INTERNAL_RESOLVED:
514 *
515 * indicates that the type was typefixed
516 */
517#define XML_SCHEMAS_TYPE_INTERNAL_RESOLVED 1 << 22
518/**
519 * XML_SCHEMAS_TYPE_INTERNAL_INVALID:
520 *
521 * indicates that the type is invalid
522 */
523#define XML_SCHEMAS_TYPE_INTERNAL_INVALID 1 << 23
Kasimier T. Buchcik4efd90d2005-06-09 10:32:53 +0000524/**
525 * XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE:
526 *
527 * a whitespace-facet value of "preserve"
528 */
529#define XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE 1 << 24
530/**
531 * XML_SCHEMAS_TYPE_WHITESPACE_REPLACE:
532 *
533 * a whitespace-facet value of "replace"
534 */
535#define XML_SCHEMAS_TYPE_WHITESPACE_REPLACE 1 << 25
536/**
537 * XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE:
538 *
539 * a whitespace-facet value of "collapse"
540 */
541#define XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE 1 << 26
542/**
543 * XML_SCHEMAS_TYPE_HAS_FACETS:
544 *
545 * has facets
546 */
547#define XML_SCHEMAS_TYPE_HAS_FACETS 1 << 27
548/**
549 * XML_SCHEMAS_TYPE_NORMVALUENEEDED:
550 *
551 * indicates if the facets (pattern) need a normalized value
552 */
553#define XML_SCHEMAS_TYPE_NORMVALUENEEDED 1 << 28
Daniel Veillard4255d502002-04-16 15:50:10 +0000554
Daniel Veillarda9b66d02002-12-11 14:23:49 +0000555/**
556 * _xmlSchemaType:
557 *
558 * Schemas type definition.
559 */
Daniel Veillard4255d502002-04-16 15:50:10 +0000560struct _xmlSchemaType {
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000561 xmlSchemaTypeType type; /* The kind of type */
Daniel Veillard4255d502002-04-16 15:50:10 +0000562 struct _xmlSchemaType *next;/* the next type if in a sequence ... */
Daniel Veillardbe9c6322003-11-22 20:37:51 +0000563 const xmlChar *name;
564 const xmlChar *id;
565 const xmlChar *ref;
566 const xmlChar *refNs;
Daniel Veillard4255d502002-04-16 15:50:10 +0000567 xmlSchemaAnnotPtr annot;
568 xmlSchemaTypePtr subtypes;
569 xmlSchemaAttributePtr attributes;
570 xmlNodePtr node;
571 int minOccurs;
572 int maxOccurs;
573
574 int flags;
575 xmlSchemaContentType contentType;
Daniel Veillardbe9c6322003-11-22 20:37:51 +0000576 const xmlChar *base;
577 const xmlChar *baseNs;
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000578 xmlSchemaTypePtr baseType;
Daniel Veillard4255d502002-04-16 15:50:10 +0000579 xmlSchemaFacetPtr facets;
Daniel Veillardb0f397e2003-12-23 23:30:53 +0000580 struct _xmlSchemaType *redef;/* possible redefinitions for the type */
Daniel Veillard2582a332004-04-18 19:49:46 +0000581 int recurse;
Daniel Veillard3646d642004-06-02 19:19:14 +0000582 xmlSchemaAttributeLinkPtr attributeUses;
583 xmlSchemaWildcardPtr attributeWildcard;
Daniel Veillard01fa6152004-06-29 17:04:39 +0000584 int builtInType;
585 xmlSchemaTypeLinkPtr memberTypes;
586 xmlSchemaFacetLinkPtr facetSet;
Daniel Veillardc0826a72004-08-10 14:17:33 +0000587 const xmlChar *refPrefix;
588 xmlSchemaTypePtr contentTypeDef;
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000589 xmlRegexpPtr contModel;
Kasimier T. Buchcik31113c72005-01-13 16:57:20 +0000590 const xmlChar *targetNamespace;
Daniel Veillard4255d502002-04-16 15:50:10 +0000591};
592
William M. Brack60f394e2003-11-16 06:25:42 +0000593/*
Daniel Veillarda9b66d02002-12-11 14:23:49 +0000594 * xmlSchemaElement:
Daniel Veillard4255d502002-04-16 15:50:10 +0000595 * An element definition.
596 *
597 * xmlSchemaType, xmlSchemaFacet and xmlSchemaElement start of
598 * structures must be kept similar
599 */
Daniel Veillarda9b66d02002-12-11 14:23:49 +0000600/**
601 * XML_SCHEMAS_ELEM_NILLABLE:
602 *
603 * the element is nillable
604 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000605#define XML_SCHEMAS_ELEM_NILLABLE 1 << 0
Daniel Veillarda9b66d02002-12-11 14:23:49 +0000606/**
607 * XML_SCHEMAS_ELEM_GLOBAL:
608 *
609 * the element is global
610 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000611#define XML_SCHEMAS_ELEM_GLOBAL 1 << 1
Daniel Veillarda9b66d02002-12-11 14:23:49 +0000612/**
613 * XML_SCHEMAS_ELEM_DEFAULT:
614 *
615 * the element has a default value
616 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000617#define XML_SCHEMAS_ELEM_DEFAULT 1 << 2
Daniel Veillarda9b66d02002-12-11 14:23:49 +0000618/**
619 * XML_SCHEMAS_ELEM_FIXED:
620 *
621 * the element has a fixed value
622 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000623#define XML_SCHEMAS_ELEM_FIXED 1 << 3
Daniel Veillarda9b66d02002-12-11 14:23:49 +0000624/**
625 * XML_SCHEMAS_ELEM_ABSTRACT:
626 *
627 * the element is abstract
628 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000629#define XML_SCHEMAS_ELEM_ABSTRACT 1 << 4
Daniel Veillarda9b66d02002-12-11 14:23:49 +0000630/**
631 * XML_SCHEMAS_ELEM_TOPLEVEL:
632 *
633 * the element is top level
Daniel Veillard3646d642004-06-02 19:19:14 +0000634 * obsolete: use XML_SCHEMAS_ELEM_GLOBAL instead
Daniel Veillarda9b66d02002-12-11 14:23:49 +0000635 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000636#define XML_SCHEMAS_ELEM_TOPLEVEL 1 << 5
Daniel Veillarda9b66d02002-12-11 14:23:49 +0000637/**
638 * XML_SCHEMAS_ELEM_REF:
639 *
640 * the element is a reference to a type
641 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000642#define XML_SCHEMAS_ELEM_REF 1 << 6
Daniel Veillardbe9c6322003-11-22 20:37:51 +0000643/**
644 * XML_SCHEMAS_ELEM_NSDEFAULT:
645 *
646 * allow elements in no namespace
Daniel Veillard01fa6152004-06-29 17:04:39 +0000647 * Obsolete, not used anymore.
Daniel Veillardbe9c6322003-11-22 20:37:51 +0000648 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000649#define XML_SCHEMAS_ELEM_NSDEFAULT 1 << 7
Daniel Veillardc0826a72004-08-10 14:17:33 +0000650/**
William M. Brack21e4ef22005-01-02 09:53:13 +0000651 * XML_SCHEMAS_ELEM_INTERNAL_RESOLVED:
Daniel Veillardc0826a72004-08-10 14:17:33 +0000652 *
653 * this is set when "type", "ref", "substitutionGroup"
654 * references have been resolved.
655 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000656#define XML_SCHEMAS_ELEM_INTERNAL_RESOLVED 1 << 8
Daniel Veillardc0826a72004-08-10 14:17:33 +0000657 /**
William M. Brack21e4ef22005-01-02 09:53:13 +0000658 * XML_SCHEMAS_ELEM_CIRCULAR:
Daniel Veillardc0826a72004-08-10 14:17:33 +0000659 *
660 * a helper flag for the search of circular references.
661 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000662#define XML_SCHEMAS_ELEM_CIRCULAR 1 << 9
Daniel Veillardc0826a72004-08-10 14:17:33 +0000663/**
664 * XML_SCHEMAS_ELEM_BLOCK_ABSENT:
665 *
666 * the "block" attribute is absent
667 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000668#define XML_SCHEMAS_ELEM_BLOCK_ABSENT 1 << 10
Daniel Veillardc0826a72004-08-10 14:17:33 +0000669/**
670 * XML_SCHEMAS_ELEM_BLOCK_EXTENSION:
671 *
672 * disallowed substitutions are absent
673 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000674#define XML_SCHEMAS_ELEM_BLOCK_EXTENSION 1 << 11
Daniel Veillardc0826a72004-08-10 14:17:33 +0000675/**
676 * XML_SCHEMAS_ELEM_BLOCK_RESTRICTION:
677 *
678 * disallowed substitutions: "restriction"
679 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000680#define XML_SCHEMAS_ELEM_BLOCK_RESTRICTION 1 << 12
Daniel Veillardc0826a72004-08-10 14:17:33 +0000681/**
682 * XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION:
683 *
684 * disallowed substitutions: "substituion"
685 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000686#define XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION 1 << 13
Daniel Veillardc0826a72004-08-10 14:17:33 +0000687/**
688 * XML_SCHEMAS_ELEM_FINAL_ABSENT:
689 *
690 * substitution group exclusions are absent
691 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000692#define XML_SCHEMAS_ELEM_FINAL_ABSENT 1 << 14
Daniel Veillardc0826a72004-08-10 14:17:33 +0000693/**
William M. Brack21e4ef22005-01-02 09:53:13 +0000694 * XML_SCHEMAS_ELEM_FINAL_EXTENSION:
Daniel Veillardc0826a72004-08-10 14:17:33 +0000695 *
696 * substitution group exclusions: "extension"
697 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000698#define XML_SCHEMAS_ELEM_FINAL_EXTENSION 1 << 15
Daniel Veillardc0826a72004-08-10 14:17:33 +0000699/**
William M. Brack21e4ef22005-01-02 09:53:13 +0000700 * XML_SCHEMAS_ELEM_FINAL_RESTRICTION:
Daniel Veillardc0826a72004-08-10 14:17:33 +0000701 *
702 * substitution group exclusions: "restriction"
703 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000704#define XML_SCHEMAS_ELEM_FINAL_RESTRICTION 1 << 16
Kasimier T. Buchcik1a99a392005-04-08 11:23:56 +0000705/**
706 * XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD:
707 *
708 * the declaration is a substitution group head
709 */
710#define XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD 1 << 17
Kasimier T. Buchcik4efd90d2005-06-09 10:32:53 +0000711/**
712 * XML_SCHEMAS_ELEM_INTERNAL_CHECKED:
713 *
714 * this is set when the elem decl has been checked against
715 * all constraints
716 */
717#define XML_SCHEMAS_ELEM_INTERNAL_CHECKED 1 << 18
Daniel Veillard4255d502002-04-16 15:50:10 +0000718
719typedef struct _xmlSchemaElement xmlSchemaElement;
720typedef xmlSchemaElement *xmlSchemaElementPtr;
721struct _xmlSchemaElement {
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000722 xmlSchemaTypeType type; /* The kind of type */
Daniel Veillard4255d502002-04-16 15:50:10 +0000723 struct _xmlSchemaType *next;/* the next type if in a sequence ... */
Daniel Veillardbe9c6322003-11-22 20:37:51 +0000724 const xmlChar *name;
725 const xmlChar *id;
Daniel Veillardc0826a72004-08-10 14:17:33 +0000726 const xmlChar *ref; /* the local name of the element declaration if a particle */
727 const xmlChar *refNs; /* the ns URI of the element declaration if a particle */
Daniel Veillard4255d502002-04-16 15:50:10 +0000728 xmlSchemaAnnotPtr annot;
Daniel Veillardc0826a72004-08-10 14:17:33 +0000729 xmlSchemaTypePtr subtypes; /* the type definition */
Daniel Veillard4255d502002-04-16 15:50:10 +0000730 xmlSchemaAttributePtr attributes;
731 xmlNodePtr node;
732 int minOccurs;
733 int maxOccurs;
734
735 int flags;
Daniel Veillardbe9c6322003-11-22 20:37:51 +0000736 const xmlChar *targetNamespace;
737 const xmlChar *namedType;
738 const xmlChar *namedTypeNs;
739 const xmlChar *substGroup;
740 const xmlChar *substGroupNs;
741 const xmlChar *scope;
742 const xmlChar *value;
Kasimier T. Buchcik1a99a392005-04-08 11:23:56 +0000743 struct _xmlSchemaElement *refDecl; /* This will now be used for the substitution group affiliation */
Daniel Veillard4255d502002-04-16 15:50:10 +0000744 xmlRegexpPtr contModel;
Daniel Veillard88c58912002-04-23 07:12:20 +0000745 xmlSchemaContentType contentType;
Daniel Veillardc0826a72004-08-10 14:17:33 +0000746 const xmlChar *refPrefix;
Kasimier T. Buchcik87876402004-09-29 13:29:03 +0000747 xmlSchemaValPtr defVal;
Kasimier T. Buchcike8a550b2005-01-27 12:49:31 +0000748 void *idcs;
Daniel Veillard4255d502002-04-16 15:50:10 +0000749};
750
Daniel Veillarda9b66d02002-12-11 14:23:49 +0000751/*
752 * XML_SCHEMAS_FACET_UNKNOWN:
Daniel Veillard4255d502002-04-16 15:50:10 +0000753 *
Daniel Veillarda9b66d02002-12-11 14:23:49 +0000754 * unknown facet handling
Daniel Veillard4255d502002-04-16 15:50:10 +0000755 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000756#define XML_SCHEMAS_FACET_UNKNOWN 0
Daniel Veillarda9b66d02002-12-11 14:23:49 +0000757/*
758 * XML_SCHEMAS_FACET_PRESERVE:
759 *
760 * preserve the type of the facet
761 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000762#define XML_SCHEMAS_FACET_PRESERVE 1
Daniel Veillarda9b66d02002-12-11 14:23:49 +0000763/*
764 * XML_SCHEMAS_FACET_REPLACE:
765 *
766 * replace the type of the facet
767 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000768#define XML_SCHEMAS_FACET_REPLACE 2
Daniel Veillarda9b66d02002-12-11 14:23:49 +0000769/*
770 * XML_SCHEMAS_FACET_COLLAPSE:
771 *
772 * collapse the types of the facet
773 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000774#define XML_SCHEMAS_FACET_COLLAPSE 3
Daniel Veillarda9b66d02002-12-11 14:23:49 +0000775/**
776 * A facet definition.
777 */
Daniel Veillard4255d502002-04-16 15:50:10 +0000778struct _xmlSchemaFacet {
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000779 xmlSchemaTypeType type; /* The kind of type */
Daniel Veillard4255d502002-04-16 15:50:10 +0000780 struct _xmlSchemaFacet *next;/* the next type if in a sequence ... */
Daniel Veillardbe9c6322003-11-22 20:37:51 +0000781 const xmlChar *value;
782 const xmlChar *id;
Daniel Veillard4255d502002-04-16 15:50:10 +0000783 xmlSchemaAnnotPtr annot;
784 xmlNodePtr node;
785 int fixed;
786 int whitespace;
787 xmlSchemaValPtr val;
788 xmlRegexpPtr regexp;
789};
790
791/**
792 * A notation definition.
793 */
794typedef struct _xmlSchemaNotation xmlSchemaNotation;
795typedef xmlSchemaNotation *xmlSchemaNotationPtr;
796struct _xmlSchemaNotation {
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000797 xmlSchemaTypeType type; /* The kind of type */
Daniel Veillardbe9c6322003-11-22 20:37:51 +0000798 const xmlChar *name;
Daniel Veillard4255d502002-04-16 15:50:10 +0000799 xmlSchemaAnnotPtr annot;
Daniel Veillardbe9c6322003-11-22 20:37:51 +0000800 const xmlChar *identifier;
Kasimier T. Buchcik31113c72005-01-13 16:57:20 +0000801 const xmlChar *targetNamespace;
Daniel Veillard4255d502002-04-16 15:50:10 +0000802};
803
804/**
Daniel Veillarda9b66d02002-12-11 14:23:49 +0000805 * XML_SCHEMAS_QUALIF_ELEM:
806 *
Daniel Veillardc0826a72004-08-10 14:17:33 +0000807 * the schema requires qualified elements
Daniel Veillard4255d502002-04-16 15:50:10 +0000808 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000809#define XML_SCHEMAS_QUALIF_ELEM 1 << 0
Daniel Veillarda9b66d02002-12-11 14:23:49 +0000810/**
811 * XML_SCHEMAS_QUALIF_ATTR:
812 *
Daniel Veillardc0826a72004-08-10 14:17:33 +0000813 * the schema requires qualified attributes
Daniel Veillarda9b66d02002-12-11 14:23:49 +0000814 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000815#define XML_SCHEMAS_QUALIF_ATTR 1 << 1
Daniel Veillard01fa6152004-06-29 17:04:39 +0000816/**
817 * XML_SCHEMAS_FINAL_DEFAULT_EXTENSION:
818 *
Daniel Veillardc0826a72004-08-10 14:17:33 +0000819 * the schema has "extension" in the set of finalDefault.
Daniel Veillard01fa6152004-06-29 17:04:39 +0000820 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000821#define XML_SCHEMAS_FINAL_DEFAULT_EXTENSION 1 << 2
Daniel Veillard01fa6152004-06-29 17:04:39 +0000822/**
823 * XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION:
824 *
Daniel Veillardc0826a72004-08-10 14:17:33 +0000825 * the schema has "restriction" in the set of finalDefault.
Daniel Veillard01fa6152004-06-29 17:04:39 +0000826 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000827#define XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION 1 << 3
Daniel Veillard01fa6152004-06-29 17:04:39 +0000828/**
829 * XML_SCHEMAS_FINAL_DEFAULT_LIST:
830 *
Daniel Veillardc0826a72004-08-10 14:17:33 +0000831 * the cshema has "list" in the set of finalDefault.
Daniel Veillard01fa6152004-06-29 17:04:39 +0000832 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000833#define XML_SCHEMAS_FINAL_DEFAULT_LIST 1 << 4
Daniel Veillard01fa6152004-06-29 17:04:39 +0000834/**
835 * XML_SCHEMAS_FINAL_DEFAULT_UNION:
836 *
Daniel Veillardc0826a72004-08-10 14:17:33 +0000837 * the schema has "union" in the set of finalDefault.
Daniel Veillard01fa6152004-06-29 17:04:39 +0000838 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000839#define XML_SCHEMAS_FINAL_DEFAULT_UNION 1 << 5
Daniel Veillarda9b66d02002-12-11 14:23:49 +0000840/**
Daniel Veillardc0826a72004-08-10 14:17:33 +0000841 * XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION:
842 *
843 * the schema has "extension" in the set of blockDefault.
844 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000845#define XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION 1 << 6
Daniel Veillardc0826a72004-08-10 14:17:33 +0000846/**
847 * XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION:
848 *
849 * the schema has "restriction" in the set of blockDefault.
850 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000851#define XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION 1 << 7
Daniel Veillardc0826a72004-08-10 14:17:33 +0000852/**
853 * XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION:
854 *
855 * the schema has "substitution" in the set of blockDefault.
856 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000857#define XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION 1 << 8
Daniel Veillardc0826a72004-08-10 14:17:33 +0000858/**
859 * XML_SCHEMAS_INCLUDING_CONVERT_NS:
860 *
861 * the schema is currently including an other schema with
862 * no target namespace.
863 */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000864#define XML_SCHEMAS_INCLUDING_CONVERT_NS 1 << 9
Daniel Veillardc0826a72004-08-10 14:17:33 +0000865/**
Daniel Veillarda9b66d02002-12-11 14:23:49 +0000866 * _xmlSchema:
867 *
868 * A Schemas definition
869 */
Daniel Veillard4255d502002-04-16 15:50:10 +0000870struct _xmlSchema {
Daniel Veillardbe9c6322003-11-22 20:37:51 +0000871 const xmlChar *name; /* schema name */
872 const xmlChar *targetNamespace; /* the target namespace */
873 const xmlChar *version;
874 const xmlChar *id;
Daniel Veillard4255d502002-04-16 15:50:10 +0000875 xmlDocPtr doc;
876 xmlSchemaAnnotPtr annot;
877 int flags;
878
879 xmlHashTablePtr typeDecl;
880 xmlHashTablePtr attrDecl;
881 xmlHashTablePtr attrgrpDecl;
882 xmlHashTablePtr elemDecl;
883 xmlHashTablePtr notaDecl;
Daniel Veillard10b6da42002-05-18 07:55:20 +0000884
885 xmlHashTablePtr schemasImports;
Daniel Veillard5f7f9912002-06-17 17:03:00 +0000886
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000887 void *_private; /* unused by the library for users or bindings */
Daniel Veillarda84c0b32003-06-02 16:58:46 +0000888 xmlHashTablePtr groupDecl;
Daniel Veillardbe9c6322003-11-22 20:37:51 +0000889 xmlDictPtr dict;
Daniel Veillardbd2904b2003-11-25 15:38:59 +0000890 void *includes; /* the includes, this is opaque for now */
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000891 int preserve; /* whether to free the document */
Kasimier T. Buchcik87876402004-09-29 13:29:03 +0000892 int counter; /* used to give ononymous components unique names */
Kasimier T. Buchcike8a550b2005-01-27 12:49:31 +0000893 xmlHashTablePtr idcDef;
Kasimier T. Buchcik1a99a392005-04-08 11:23:56 +0000894 void *volatiles; /* Misc. helper items (e.g. reference items) */
Daniel Veillard4255d502002-04-16 15:50:10 +0000895};
896
Kasimier T. Buchcik876a6db2004-09-16 11:31:52 +0000897XMLPUBFUN void XMLCALL xmlSchemaFreeType (xmlSchemaTypePtr type);
898XMLPUBFUN void XMLCALL xmlSchemaFreeWildcard(xmlSchemaWildcardPtr wildcard);
Daniel Veillard4255d502002-04-16 15:50:10 +0000899
900#ifdef __cplusplus
901}
902#endif
903
904#endif /* LIBXML_SCHEMAS_ENABLED */
905#endif /* __XML_SCHEMA_INTERNALS_H__ */