Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-11 08:36:03

0001 /*
0002  * Summary: internal interfaces for XML Schemas
0003  * Description: internal interfaces for the XML Schemas handling
0004  *              and schema validity checking
0005  *      The Schemas development is a Work In Progress.
0006  *              Some of those interfaces are not guaranteed to be API or ABI stable !
0007  *
0008  * Copy: See Copyright for the status of this software.
0009  *
0010  * Author: Daniel Veillard
0011  */
0012 
0013 
0014 #ifndef __XML_SCHEMA_INTERNALS_H__
0015 #define __XML_SCHEMA_INTERNALS_H__
0016 
0017 #include <libxml/xmlversion.h>
0018 
0019 #ifdef LIBXML_SCHEMAS_ENABLED
0020 
0021 #include <libxml/xmlregexp.h>
0022 #include <libxml/hash.h>
0023 #include <libxml/dict.h>
0024 #include <libxml/tree.h>
0025 
0026 #ifdef __cplusplus
0027 extern "C" {
0028 #endif
0029 
0030 typedef enum {
0031     XML_SCHEMAS_UNKNOWN = 0,
0032     XML_SCHEMAS_STRING = 1,
0033     XML_SCHEMAS_NORMSTRING = 2,
0034     XML_SCHEMAS_DECIMAL = 3,
0035     XML_SCHEMAS_TIME = 4,
0036     XML_SCHEMAS_GDAY = 5,
0037     XML_SCHEMAS_GMONTH = 6,
0038     XML_SCHEMAS_GMONTHDAY = 7,
0039     XML_SCHEMAS_GYEAR = 8,
0040     XML_SCHEMAS_GYEARMONTH = 9,
0041     XML_SCHEMAS_DATE = 10,
0042     XML_SCHEMAS_DATETIME = 11,
0043     XML_SCHEMAS_DURATION = 12,
0044     XML_SCHEMAS_FLOAT = 13,
0045     XML_SCHEMAS_DOUBLE = 14,
0046     XML_SCHEMAS_BOOLEAN = 15,
0047     XML_SCHEMAS_TOKEN = 16,
0048     XML_SCHEMAS_LANGUAGE = 17,
0049     XML_SCHEMAS_NMTOKEN = 18,
0050     XML_SCHEMAS_NMTOKENS = 19,
0051     XML_SCHEMAS_NAME = 20,
0052     XML_SCHEMAS_QNAME = 21,
0053     XML_SCHEMAS_NCNAME = 22,
0054     XML_SCHEMAS_ID = 23,
0055     XML_SCHEMAS_IDREF = 24,
0056     XML_SCHEMAS_IDREFS = 25,
0057     XML_SCHEMAS_ENTITY = 26,
0058     XML_SCHEMAS_ENTITIES = 27,
0059     XML_SCHEMAS_NOTATION = 28,
0060     XML_SCHEMAS_ANYURI = 29,
0061     XML_SCHEMAS_INTEGER = 30,
0062     XML_SCHEMAS_NPINTEGER = 31,
0063     XML_SCHEMAS_NINTEGER = 32,
0064     XML_SCHEMAS_NNINTEGER = 33,
0065     XML_SCHEMAS_PINTEGER = 34,
0066     XML_SCHEMAS_INT = 35,
0067     XML_SCHEMAS_UINT = 36,
0068     XML_SCHEMAS_LONG = 37,
0069     XML_SCHEMAS_ULONG = 38,
0070     XML_SCHEMAS_SHORT = 39,
0071     XML_SCHEMAS_USHORT = 40,
0072     XML_SCHEMAS_BYTE = 41,
0073     XML_SCHEMAS_UBYTE = 42,
0074     XML_SCHEMAS_HEXBINARY = 43,
0075     XML_SCHEMAS_BASE64BINARY = 44,
0076     XML_SCHEMAS_ANYTYPE = 45,
0077     XML_SCHEMAS_ANYSIMPLETYPE = 46
0078 } xmlSchemaValType;
0079 
0080 /*
0081  * XML Schemas defines multiple type of types.
0082  */
0083 typedef enum {
0084     XML_SCHEMA_TYPE_BASIC = 1, /* A built-in datatype */
0085     XML_SCHEMA_TYPE_ANY,
0086     XML_SCHEMA_TYPE_FACET,
0087     XML_SCHEMA_TYPE_SIMPLE,
0088     XML_SCHEMA_TYPE_COMPLEX,
0089     XML_SCHEMA_TYPE_SEQUENCE = 6,
0090     XML_SCHEMA_TYPE_CHOICE,
0091     XML_SCHEMA_TYPE_ALL,
0092     XML_SCHEMA_TYPE_SIMPLE_CONTENT,
0093     XML_SCHEMA_TYPE_COMPLEX_CONTENT,
0094     XML_SCHEMA_TYPE_UR,
0095     XML_SCHEMA_TYPE_RESTRICTION,
0096     XML_SCHEMA_TYPE_EXTENSION,
0097     XML_SCHEMA_TYPE_ELEMENT,
0098     XML_SCHEMA_TYPE_ATTRIBUTE,
0099     XML_SCHEMA_TYPE_ATTRIBUTEGROUP,
0100     XML_SCHEMA_TYPE_GROUP,
0101     XML_SCHEMA_TYPE_NOTATION,
0102     XML_SCHEMA_TYPE_LIST,
0103     XML_SCHEMA_TYPE_UNION,
0104     XML_SCHEMA_TYPE_ANY_ATTRIBUTE,
0105     XML_SCHEMA_TYPE_IDC_UNIQUE,
0106     XML_SCHEMA_TYPE_IDC_KEY,
0107     XML_SCHEMA_TYPE_IDC_KEYREF,
0108     XML_SCHEMA_TYPE_PARTICLE = 25,
0109     XML_SCHEMA_TYPE_ATTRIBUTE_USE,
0110     XML_SCHEMA_FACET_MININCLUSIVE = 1000,
0111     XML_SCHEMA_FACET_MINEXCLUSIVE,
0112     XML_SCHEMA_FACET_MAXINCLUSIVE,
0113     XML_SCHEMA_FACET_MAXEXCLUSIVE,
0114     XML_SCHEMA_FACET_TOTALDIGITS,
0115     XML_SCHEMA_FACET_FRACTIONDIGITS,
0116     XML_SCHEMA_FACET_PATTERN,
0117     XML_SCHEMA_FACET_ENUMERATION,
0118     XML_SCHEMA_FACET_WHITESPACE,
0119     XML_SCHEMA_FACET_LENGTH,
0120     XML_SCHEMA_FACET_MAXLENGTH,
0121     XML_SCHEMA_FACET_MINLENGTH,
0122     XML_SCHEMA_EXTRA_QNAMEREF = 2000,
0123     XML_SCHEMA_EXTRA_ATTR_USE_PROHIB
0124 } xmlSchemaTypeType;
0125 
0126 typedef enum {
0127     XML_SCHEMA_CONTENT_UNKNOWN = 0,
0128     XML_SCHEMA_CONTENT_EMPTY = 1,
0129     XML_SCHEMA_CONTENT_ELEMENTS,
0130     XML_SCHEMA_CONTENT_MIXED,
0131     XML_SCHEMA_CONTENT_SIMPLE,
0132     XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS, /* Obsolete */
0133     XML_SCHEMA_CONTENT_BASIC,
0134     XML_SCHEMA_CONTENT_ANY
0135 } xmlSchemaContentType;
0136 
0137 typedef struct _xmlSchemaVal xmlSchemaVal;
0138 typedef xmlSchemaVal *xmlSchemaValPtr;
0139 
0140 typedef struct _xmlSchemaType xmlSchemaType;
0141 typedef xmlSchemaType *xmlSchemaTypePtr;
0142 
0143 typedef struct _xmlSchemaFacet xmlSchemaFacet;
0144 typedef xmlSchemaFacet *xmlSchemaFacetPtr;
0145 
0146 /**
0147  * Annotation
0148  */
0149 typedef struct _xmlSchemaAnnot xmlSchemaAnnot;
0150 typedef xmlSchemaAnnot *xmlSchemaAnnotPtr;
0151 struct _xmlSchemaAnnot {
0152     struct _xmlSchemaAnnot *next;
0153     xmlNodePtr content;         /* the annotation */
0154 };
0155 
0156 /**
0157  * XML_SCHEMAS_ANYATTR_SKIP:
0158  *
0159  * Skip unknown attribute from validation
0160  * Obsolete, not used anymore.
0161  */
0162 #define XML_SCHEMAS_ANYATTR_SKIP        1
0163 /**
0164  * XML_SCHEMAS_ANYATTR_LAX:
0165  *
0166  * Ignore validation non definition on attributes
0167  * Obsolete, not used anymore.
0168  */
0169 #define XML_SCHEMAS_ANYATTR_LAX                2
0170 /**
0171  * XML_SCHEMAS_ANYATTR_STRICT:
0172  *
0173  * Apply strict validation rules on attributes
0174  * Obsolete, not used anymore.
0175  */
0176 #define XML_SCHEMAS_ANYATTR_STRICT        3
0177 /**
0178  * XML_SCHEMAS_ANY_SKIP:
0179  *
0180  * Skip unknown attribute from validation
0181  */
0182 #define XML_SCHEMAS_ANY_SKIP        1
0183 /**
0184  * XML_SCHEMAS_ANY_LAX:
0185  *
0186  * Used by wildcards.
0187  * Validate if type found, don't worry if not found
0188  */
0189 #define XML_SCHEMAS_ANY_LAX                2
0190 /**
0191  * XML_SCHEMAS_ANY_STRICT:
0192  *
0193  * Used by wildcards.
0194  * Apply strict validation rules
0195  */
0196 #define XML_SCHEMAS_ANY_STRICT        3
0197 /**
0198  * XML_SCHEMAS_ATTR_USE_PROHIBITED:
0199  *
0200  * Used by wildcards.
0201  * The attribute is prohibited.
0202  */
0203 #define XML_SCHEMAS_ATTR_USE_PROHIBITED 0
0204 /**
0205  * XML_SCHEMAS_ATTR_USE_REQUIRED:
0206  *
0207  * The attribute is required.
0208  */
0209 #define XML_SCHEMAS_ATTR_USE_REQUIRED 1
0210 /**
0211  * XML_SCHEMAS_ATTR_USE_OPTIONAL:
0212  *
0213  * The attribute is optional.
0214  */
0215 #define XML_SCHEMAS_ATTR_USE_OPTIONAL 2
0216 /**
0217  * XML_SCHEMAS_ATTR_GLOBAL:
0218  *
0219  * allow elements in no namespace
0220  */
0221 #define XML_SCHEMAS_ATTR_GLOBAL        1 << 0
0222 /**
0223  * XML_SCHEMAS_ATTR_NSDEFAULT:
0224  *
0225  * allow elements in no namespace
0226  */
0227 #define XML_SCHEMAS_ATTR_NSDEFAULT        1 << 7
0228 /**
0229  * XML_SCHEMAS_ATTR_INTERNAL_RESOLVED:
0230  *
0231  * this is set when the "type" and "ref" references
0232  * have been resolved.
0233  */
0234 #define XML_SCHEMAS_ATTR_INTERNAL_RESOLVED        1 << 8
0235 /**
0236  * XML_SCHEMAS_ATTR_FIXED:
0237  *
0238  * the attribute has a fixed value
0239  */
0240 #define XML_SCHEMAS_ATTR_FIXED        1 << 9
0241 
0242 /**
0243  * xmlSchemaAttribute:
0244  * An attribute definition.
0245  */
0246 
0247 typedef struct _xmlSchemaAttribute xmlSchemaAttribute;
0248 typedef xmlSchemaAttribute *xmlSchemaAttributePtr;
0249 struct _xmlSchemaAttribute {
0250     xmlSchemaTypeType type;
0251     struct _xmlSchemaAttribute *next; /* the next attribute (not used?) */
0252     const xmlChar *name; /* the name of the declaration */
0253     const xmlChar *id; /* Deprecated; not used */
0254     const xmlChar *ref; /* Deprecated; not used */
0255     const xmlChar *refNs; /* Deprecated; not used */
0256     const xmlChar *typeName; /* the local name of the type definition */
0257     const xmlChar *typeNs; /* the ns URI of the type definition */
0258     xmlSchemaAnnotPtr annot;
0259 
0260     xmlSchemaTypePtr base; /* Deprecated; not used */
0261     int occurs; /* Deprecated; not used */
0262     const xmlChar *defValue; /* The initial value of the value constraint */
0263     xmlSchemaTypePtr subtypes; /* the type definition */
0264     xmlNodePtr node;
0265     const xmlChar *targetNamespace;
0266     int flags;
0267     const xmlChar *refPrefix; /* Deprecated; not used */
0268     xmlSchemaValPtr defVal; /* The compiled value constraint */
0269     xmlSchemaAttributePtr refDecl; /* Deprecated; not used */
0270 };
0271 
0272 /**
0273  * xmlSchemaAttributeLink:
0274  * Used to build a list of attribute uses on complexType definitions.
0275  * WARNING: Deprecated; not used.
0276  */
0277 typedef struct _xmlSchemaAttributeLink xmlSchemaAttributeLink;
0278 typedef xmlSchemaAttributeLink *xmlSchemaAttributeLinkPtr;
0279 struct _xmlSchemaAttributeLink {
0280     struct _xmlSchemaAttributeLink *next;/* the next attribute link ... */
0281     struct _xmlSchemaAttribute *attr;/* the linked attribute */
0282 };
0283 
0284 /**
0285  * XML_SCHEMAS_WILDCARD_COMPLETE:
0286  *
0287  * If the wildcard is complete.
0288  */
0289 #define XML_SCHEMAS_WILDCARD_COMPLETE 1 << 0
0290 
0291 /**
0292  * xmlSchemaCharValueLink:
0293  * Used to build a list of namespaces on wildcards.
0294  */
0295 typedef struct _xmlSchemaWildcardNs xmlSchemaWildcardNs;
0296 typedef xmlSchemaWildcardNs *xmlSchemaWildcardNsPtr;
0297 struct _xmlSchemaWildcardNs {
0298     struct _xmlSchemaWildcardNs *next;/* the next constraint link ... */
0299     const xmlChar *value;/* the value */
0300 };
0301 
0302 /**
0303  * xmlSchemaWildcard.
0304  * A wildcard.
0305  */
0306 typedef struct _xmlSchemaWildcard xmlSchemaWildcard;
0307 typedef xmlSchemaWildcard *xmlSchemaWildcardPtr;
0308 struct _xmlSchemaWildcard {
0309     xmlSchemaTypeType type;        /* The kind of type */
0310     const xmlChar *id; /* Deprecated; not used */
0311     xmlSchemaAnnotPtr annot;
0312     xmlNodePtr node;
0313     int minOccurs; /* Deprecated; not used */
0314     int maxOccurs; /* Deprecated; not used */
0315     int processContents;
0316     int any; /* Indicates if the ns constraint is of ##any */
0317     xmlSchemaWildcardNsPtr nsSet; /* The list of allowed namespaces */
0318     xmlSchemaWildcardNsPtr negNsSet; /* The negated namespace */
0319     int flags;
0320 };
0321 
0322 /**
0323  * XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED:
0324  *
0325  * The attribute wildcard has been built.
0326  */
0327 #define XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED 1 << 0
0328 /**
0329  * XML_SCHEMAS_ATTRGROUP_GLOBAL:
0330  *
0331  * The attribute group has been defined.
0332  */
0333 #define XML_SCHEMAS_ATTRGROUP_GLOBAL 1 << 1
0334 /**
0335  * XML_SCHEMAS_ATTRGROUP_MARKED:
0336  *
0337  * Marks the attr group as marked; used for circular checks.
0338  */
0339 #define XML_SCHEMAS_ATTRGROUP_MARKED 1 << 2
0340 
0341 /**
0342  * XML_SCHEMAS_ATTRGROUP_REDEFINED:
0343  *
0344  * The attr group was redefined.
0345  */
0346 #define XML_SCHEMAS_ATTRGROUP_REDEFINED 1 << 3
0347 /**
0348  * XML_SCHEMAS_ATTRGROUP_HAS_REFS:
0349  *
0350  * Whether this attr. group contains attr. group references.
0351  */
0352 #define XML_SCHEMAS_ATTRGROUP_HAS_REFS 1 << 4
0353 
0354 /**
0355  * An attribute group definition.
0356  *
0357  * xmlSchemaAttribute and xmlSchemaAttributeGroup start of structures
0358  * must be kept similar
0359  */
0360 typedef struct _xmlSchemaAttributeGroup xmlSchemaAttributeGroup;
0361 typedef xmlSchemaAttributeGroup *xmlSchemaAttributeGroupPtr;
0362 struct _xmlSchemaAttributeGroup {
0363     xmlSchemaTypeType type;        /* The kind of type */
0364     struct _xmlSchemaAttribute *next;/* the next attribute if in a group ... */
0365     const xmlChar *name;
0366     const xmlChar *id;
0367     const xmlChar *ref; /* Deprecated; not used */
0368     const xmlChar *refNs; /* Deprecated; not used */
0369     xmlSchemaAnnotPtr annot;
0370 
0371     xmlSchemaAttributePtr attributes; /* Deprecated; not used */
0372     xmlNodePtr node;
0373     int flags;
0374     xmlSchemaWildcardPtr attributeWildcard;
0375     const xmlChar *refPrefix; /* Deprecated; not used */
0376     xmlSchemaAttributeGroupPtr refItem; /* Deprecated; not used */
0377     const xmlChar *targetNamespace;
0378     void *attrUses;
0379 };
0380 
0381 /**
0382  * xmlSchemaTypeLink:
0383  * Used to build a list of types (e.g. member types of
0384  * simpleType with variety "union").
0385  */
0386 typedef struct _xmlSchemaTypeLink xmlSchemaTypeLink;
0387 typedef xmlSchemaTypeLink *xmlSchemaTypeLinkPtr;
0388 struct _xmlSchemaTypeLink {
0389     struct _xmlSchemaTypeLink *next;/* the next type link ... */
0390     xmlSchemaTypePtr type;/* the linked type */
0391 };
0392 
0393 /**
0394  * xmlSchemaFacetLink:
0395  * Used to build a list of facets.
0396  */
0397 typedef struct _xmlSchemaFacetLink xmlSchemaFacetLink;
0398 typedef xmlSchemaFacetLink *xmlSchemaFacetLinkPtr;
0399 struct _xmlSchemaFacetLink {
0400     struct _xmlSchemaFacetLink *next;/* the next facet link ... */
0401     xmlSchemaFacetPtr facet;/* the linked facet */
0402 };
0403 
0404 /**
0405  * XML_SCHEMAS_TYPE_MIXED:
0406  *
0407  * the element content type is mixed
0408  */
0409 #define XML_SCHEMAS_TYPE_MIXED                1 << 0
0410 /**
0411  * XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION:
0412  *
0413  * the simple or complex type has a derivation method of "extension".
0414  */
0415 #define XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION                1 << 1
0416 /**
0417  * XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION:
0418  *
0419  * the simple or complex type has a derivation method of "restriction".
0420  */
0421 #define XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION                1 << 2
0422 /**
0423  * XML_SCHEMAS_TYPE_GLOBAL:
0424  *
0425  * the type is global
0426  */
0427 #define XML_SCHEMAS_TYPE_GLOBAL                1 << 3
0428 /**
0429  * XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD:
0430  *
0431  * the complexType owns an attribute wildcard, i.e.
0432  * it can be freed by the complexType
0433  */
0434 #define XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD    1 << 4 /* Obsolete. */
0435 /**
0436  * XML_SCHEMAS_TYPE_VARIETY_ABSENT:
0437  *
0438  * the simpleType has a variety of "absent".
0439  * TODO: Actually not necessary :-/, since if
0440  * none of the variety flags occur then it's
0441  * automatically absent.
0442  */
0443 #define XML_SCHEMAS_TYPE_VARIETY_ABSENT    1 << 5
0444 /**
0445  * XML_SCHEMAS_TYPE_VARIETY_LIST:
0446  *
0447  * the simpleType has a variety of "list".
0448  */
0449 #define XML_SCHEMAS_TYPE_VARIETY_LIST    1 << 6
0450 /**
0451  * XML_SCHEMAS_TYPE_VARIETY_UNION:
0452  *
0453  * the simpleType has a variety of "union".
0454  */
0455 #define XML_SCHEMAS_TYPE_VARIETY_UNION    1 << 7
0456 /**
0457  * XML_SCHEMAS_TYPE_VARIETY_ATOMIC:
0458  *
0459  * the simpleType has a variety of "union".
0460  */
0461 #define XML_SCHEMAS_TYPE_VARIETY_ATOMIC    1 << 8
0462 /**
0463  * XML_SCHEMAS_TYPE_FINAL_EXTENSION:
0464  *
0465  * the complexType has a final of "extension".
0466  */
0467 #define XML_SCHEMAS_TYPE_FINAL_EXTENSION    1 << 9
0468 /**
0469  * XML_SCHEMAS_TYPE_FINAL_RESTRICTION:
0470  *
0471  * the simpleType/complexType has a final of "restriction".
0472  */
0473 #define XML_SCHEMAS_TYPE_FINAL_RESTRICTION    1 << 10
0474 /**
0475  * XML_SCHEMAS_TYPE_FINAL_LIST:
0476  *
0477  * the simpleType has a final of "list".
0478  */
0479 #define XML_SCHEMAS_TYPE_FINAL_LIST    1 << 11
0480 /**
0481  * XML_SCHEMAS_TYPE_FINAL_UNION:
0482  *
0483  * the simpleType has a final of "union".
0484  */
0485 #define XML_SCHEMAS_TYPE_FINAL_UNION    1 << 12
0486 /**
0487  * XML_SCHEMAS_TYPE_FINAL_DEFAULT:
0488  *
0489  * the simpleType has a final of "default".
0490  */
0491 #define XML_SCHEMAS_TYPE_FINAL_DEFAULT    1 << 13
0492 /**
0493  * XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE:
0494  *
0495  * Marks the item as a builtin primitive.
0496  */
0497 #define XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE    1 << 14
0498 /**
0499  * XML_SCHEMAS_TYPE_MARKED:
0500  *
0501  * Marks the item as marked; used for circular checks.
0502  */
0503 #define XML_SCHEMAS_TYPE_MARKED        1 << 16
0504 /**
0505  * XML_SCHEMAS_TYPE_BLOCK_DEFAULT:
0506  *
0507  * the complexType did not specify 'block' so use the default of the
0508  * <schema> item.
0509  */
0510 #define XML_SCHEMAS_TYPE_BLOCK_DEFAULT    1 << 17
0511 /**
0512  * XML_SCHEMAS_TYPE_BLOCK_EXTENSION:
0513  *
0514  * the complexType has a 'block' of "extension".
0515  */
0516 #define XML_SCHEMAS_TYPE_BLOCK_EXTENSION    1 << 18
0517 /**
0518  * XML_SCHEMAS_TYPE_BLOCK_RESTRICTION:
0519  *
0520  * the complexType has a 'block' of "restriction".
0521  */
0522 #define XML_SCHEMAS_TYPE_BLOCK_RESTRICTION    1 << 19
0523 /**
0524  * XML_SCHEMAS_TYPE_ABSTRACT:
0525  *
0526  * the simple/complexType is abstract.
0527  */
0528 #define XML_SCHEMAS_TYPE_ABSTRACT    1 << 20
0529 /**
0530  * XML_SCHEMAS_TYPE_FACETSNEEDVALUE:
0531  *
0532  * indicates if the facets need a computed value
0533  */
0534 #define XML_SCHEMAS_TYPE_FACETSNEEDVALUE    1 << 21
0535 /**
0536  * XML_SCHEMAS_TYPE_INTERNAL_RESOLVED:
0537  *
0538  * indicates that the type was typefixed
0539  */
0540 #define XML_SCHEMAS_TYPE_INTERNAL_RESOLVED    1 << 22
0541 /**
0542  * XML_SCHEMAS_TYPE_INTERNAL_INVALID:
0543  *
0544  * indicates that the type is invalid
0545  */
0546 #define XML_SCHEMAS_TYPE_INTERNAL_INVALID    1 << 23
0547 /**
0548  * XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE:
0549  *
0550  * a whitespace-facet value of "preserve"
0551  */
0552 #define XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE    1 << 24
0553 /**
0554  * XML_SCHEMAS_TYPE_WHITESPACE_REPLACE:
0555  *
0556  * a whitespace-facet value of "replace"
0557  */
0558 #define XML_SCHEMAS_TYPE_WHITESPACE_REPLACE    1 << 25
0559 /**
0560  * XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE:
0561  *
0562  * a whitespace-facet value of "collapse"
0563  */
0564 #define XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE    1 << 26
0565 /**
0566  * XML_SCHEMAS_TYPE_HAS_FACETS:
0567  *
0568  * has facets
0569  */
0570 #define XML_SCHEMAS_TYPE_HAS_FACETS    1 << 27
0571 /**
0572  * XML_SCHEMAS_TYPE_NORMVALUENEEDED:
0573  *
0574  * indicates if the facets (pattern) need a normalized value
0575  */
0576 #define XML_SCHEMAS_TYPE_NORMVALUENEEDED    1 << 28
0577 
0578 /**
0579  * XML_SCHEMAS_TYPE_FIXUP_1:
0580  *
0581  * First stage of fixup was done.
0582  */
0583 #define XML_SCHEMAS_TYPE_FIXUP_1    1 << 29
0584 
0585 /**
0586  * XML_SCHEMAS_TYPE_REDEFINED:
0587  *
0588  * The type was redefined.
0589  */
0590 #define XML_SCHEMAS_TYPE_REDEFINED    1 << 30
0591 /**
0592  * XML_SCHEMAS_TYPE_REDEFINING:
0593  *
0594  * The type redefines an other type.
0595  */
0596 /* #define XML_SCHEMAS_TYPE_REDEFINING    1 << 31 */
0597 
0598 /**
0599  * _xmlSchemaType:
0600  *
0601  * Schemas type definition.
0602  */
0603 struct _xmlSchemaType {
0604     xmlSchemaTypeType type; /* The kind of type */
0605     struct _xmlSchemaType *next; /* the next type if in a sequence ... */
0606     const xmlChar *name;
0607     const xmlChar *id ; /* Deprecated; not used */
0608     const xmlChar *ref; /* Deprecated; not used */
0609     const xmlChar *refNs; /* Deprecated; not used */
0610     xmlSchemaAnnotPtr annot;
0611     xmlSchemaTypePtr subtypes;
0612     xmlSchemaAttributePtr attributes; /* Deprecated; not used */
0613     xmlNodePtr node;
0614     int minOccurs; /* Deprecated; not used */
0615     int maxOccurs; /* Deprecated; not used */
0616 
0617     int flags;
0618     xmlSchemaContentType contentType;
0619     const xmlChar *base; /* Base type's local name */
0620     const xmlChar *baseNs; /* Base type's target namespace */
0621     xmlSchemaTypePtr baseType; /* The base type component */
0622     xmlSchemaFacetPtr facets; /* Local facets */
0623     struct _xmlSchemaType *redef; /* Deprecated; not used */
0624     int recurse; /* Obsolete */
0625     xmlSchemaAttributeLinkPtr *attributeUses; /* Deprecated; not used */
0626     xmlSchemaWildcardPtr attributeWildcard;
0627     int builtInType; /* Type of built-in types. */
0628     xmlSchemaTypeLinkPtr memberTypes; /* member-types if a union type. */
0629     xmlSchemaFacetLinkPtr facetSet; /* All facets (incl. inherited) */
0630     const xmlChar *refPrefix; /* Deprecated; not used */
0631     xmlSchemaTypePtr contentTypeDef; /* Used for the simple content of complex types.
0632                                         Could we use @subtypes for this? */
0633     xmlRegexpPtr contModel; /* Holds the automaton of the content model */
0634     const xmlChar *targetNamespace;
0635     void *attrUses;
0636 };
0637 
0638 /*
0639  * xmlSchemaElement:
0640  * An element definition.
0641  *
0642  * xmlSchemaType, xmlSchemaFacet and xmlSchemaElement start of
0643  * structures must be kept similar
0644  */
0645 /**
0646  * XML_SCHEMAS_ELEM_NILLABLE:
0647  *
0648  * the element is nillable
0649  */
0650 #define XML_SCHEMAS_ELEM_NILLABLE        1 << 0
0651 /**
0652  * XML_SCHEMAS_ELEM_GLOBAL:
0653  *
0654  * the element is global
0655  */
0656 #define XML_SCHEMAS_ELEM_GLOBAL                1 << 1
0657 /**
0658  * XML_SCHEMAS_ELEM_DEFAULT:
0659  *
0660  * the element has a default value
0661  */
0662 #define XML_SCHEMAS_ELEM_DEFAULT        1 << 2
0663 /**
0664  * XML_SCHEMAS_ELEM_FIXED:
0665  *
0666  * the element has a fixed value
0667  */
0668 #define XML_SCHEMAS_ELEM_FIXED                1 << 3
0669 /**
0670  * XML_SCHEMAS_ELEM_ABSTRACT:
0671  *
0672  * the element is abstract
0673  */
0674 #define XML_SCHEMAS_ELEM_ABSTRACT        1 << 4
0675 /**
0676  * XML_SCHEMAS_ELEM_TOPLEVEL:
0677  *
0678  * the element is top level
0679  * obsolete: use XML_SCHEMAS_ELEM_GLOBAL instead
0680  */
0681 #define XML_SCHEMAS_ELEM_TOPLEVEL        1 << 5
0682 /**
0683  * XML_SCHEMAS_ELEM_REF:
0684  *
0685  * the element is a reference to a type
0686  */
0687 #define XML_SCHEMAS_ELEM_REF                1 << 6
0688 /**
0689  * XML_SCHEMAS_ELEM_NSDEFAULT:
0690  *
0691  * allow elements in no namespace
0692  * Obsolete, not used anymore.
0693  */
0694 #define XML_SCHEMAS_ELEM_NSDEFAULT        1 << 7
0695 /**
0696  * XML_SCHEMAS_ELEM_INTERNAL_RESOLVED:
0697  *
0698  * this is set when "type", "ref", "substitutionGroup"
0699  * references have been resolved.
0700  */
0701 #define XML_SCHEMAS_ELEM_INTERNAL_RESOLVED        1 << 8
0702  /**
0703  * XML_SCHEMAS_ELEM_CIRCULAR:
0704  *
0705  * a helper flag for the search of circular references.
0706  */
0707 #define XML_SCHEMAS_ELEM_CIRCULAR        1 << 9
0708 /**
0709  * XML_SCHEMAS_ELEM_BLOCK_ABSENT:
0710  *
0711  * the "block" attribute is absent
0712  */
0713 #define XML_SCHEMAS_ELEM_BLOCK_ABSENT        1 << 10
0714 /**
0715  * XML_SCHEMAS_ELEM_BLOCK_EXTENSION:
0716  *
0717  * disallowed substitutions are absent
0718  */
0719 #define XML_SCHEMAS_ELEM_BLOCK_EXTENSION        1 << 11
0720 /**
0721  * XML_SCHEMAS_ELEM_BLOCK_RESTRICTION:
0722  *
0723  * disallowed substitutions: "restriction"
0724  */
0725 #define XML_SCHEMAS_ELEM_BLOCK_RESTRICTION        1 << 12
0726 /**
0727  * XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION:
0728  *
0729  * disallowed substitutions: "substitution"
0730  */
0731 #define XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION        1 << 13
0732 /**
0733  * XML_SCHEMAS_ELEM_FINAL_ABSENT:
0734  *
0735  * substitution group exclusions are absent
0736  */
0737 #define XML_SCHEMAS_ELEM_FINAL_ABSENT        1 << 14
0738 /**
0739  * XML_SCHEMAS_ELEM_FINAL_EXTENSION:
0740  *
0741  * substitution group exclusions: "extension"
0742  */
0743 #define XML_SCHEMAS_ELEM_FINAL_EXTENSION        1 << 15
0744 /**
0745  * XML_SCHEMAS_ELEM_FINAL_RESTRICTION:
0746  *
0747  * substitution group exclusions: "restriction"
0748  */
0749 #define XML_SCHEMAS_ELEM_FINAL_RESTRICTION        1 << 16
0750 /**
0751  * XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD:
0752  *
0753  * the declaration is a substitution group head
0754  */
0755 #define XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD        1 << 17
0756 /**
0757  * XML_SCHEMAS_ELEM_INTERNAL_CHECKED:
0758  *
0759  * this is set when the elem decl has been checked against
0760  * all constraints
0761  */
0762 #define XML_SCHEMAS_ELEM_INTERNAL_CHECKED        1 << 18
0763 
0764 typedef struct _xmlSchemaElement xmlSchemaElement;
0765 typedef xmlSchemaElement *xmlSchemaElementPtr;
0766 struct _xmlSchemaElement {
0767     xmlSchemaTypeType type; /* The kind of type */
0768     struct _xmlSchemaType *next; /* Not used? */
0769     const xmlChar *name;
0770     const xmlChar *id; /* Deprecated; not used */
0771     const xmlChar *ref; /* Deprecated; not used */
0772     const xmlChar *refNs; /* Deprecated; not used */
0773     xmlSchemaAnnotPtr annot;
0774     xmlSchemaTypePtr subtypes; /* the type definition */
0775     xmlSchemaAttributePtr attributes;
0776     xmlNodePtr node;
0777     int minOccurs; /* Deprecated; not used */
0778     int maxOccurs; /* Deprecated; not used */
0779 
0780     int flags;
0781     const xmlChar *targetNamespace;
0782     const xmlChar *namedType;
0783     const xmlChar *namedTypeNs;
0784     const xmlChar *substGroup;
0785     const xmlChar *substGroupNs;
0786     const xmlChar *scope;
0787     const xmlChar *value; /* The original value of the value constraint. */
0788     struct _xmlSchemaElement *refDecl; /* This will now be used for the
0789                                           substitution group affiliation */
0790     xmlRegexpPtr contModel; /* Obsolete for WXS, maybe used for RelaxNG */
0791     xmlSchemaContentType contentType;
0792     const xmlChar *refPrefix; /* Deprecated; not used */
0793     xmlSchemaValPtr defVal; /* The compiled value constraint. */
0794     void *idcs; /* The identity-constraint defs */
0795 };
0796 
0797 /*
0798  * XML_SCHEMAS_FACET_UNKNOWN:
0799  *
0800  * unknown facet handling
0801  */
0802 #define XML_SCHEMAS_FACET_UNKNOWN        0
0803 /*
0804  * XML_SCHEMAS_FACET_PRESERVE:
0805  *
0806  * preserve the type of the facet
0807  */
0808 #define XML_SCHEMAS_FACET_PRESERVE        1
0809 /*
0810  * XML_SCHEMAS_FACET_REPLACE:
0811  *
0812  * replace the type of the facet
0813  */
0814 #define XML_SCHEMAS_FACET_REPLACE        2
0815 /*
0816  * XML_SCHEMAS_FACET_COLLAPSE:
0817  *
0818  * collapse the types of the facet
0819  */
0820 #define XML_SCHEMAS_FACET_COLLAPSE        3
0821 /**
0822  * A facet definition.
0823  */
0824 struct _xmlSchemaFacet {
0825     xmlSchemaTypeType type;        /* The kind of type */
0826     struct _xmlSchemaFacet *next;/* the next type if in a sequence ... */
0827     const xmlChar *value; /* The original value */
0828     const xmlChar *id; /* Obsolete */
0829     xmlSchemaAnnotPtr annot;
0830     xmlNodePtr node;
0831     int fixed; /* XML_SCHEMAS_FACET_PRESERVE, etc. */
0832     int whitespace;
0833     xmlSchemaValPtr val; /* The compiled value */
0834     xmlRegexpPtr    regexp; /* The regex for patterns */
0835 };
0836 
0837 /**
0838  * A notation definition.
0839  */
0840 typedef struct _xmlSchemaNotation xmlSchemaNotation;
0841 typedef xmlSchemaNotation *xmlSchemaNotationPtr;
0842 struct _xmlSchemaNotation {
0843     xmlSchemaTypeType type; /* The kind of type */
0844     const xmlChar *name;
0845     xmlSchemaAnnotPtr annot;
0846     const xmlChar *identifier;
0847     const xmlChar *targetNamespace;
0848 };
0849 
0850 /*
0851 * TODO: Actually all those flags used for the schema should sit
0852 * on the schema parser context, since they are used only
0853 * during parsing an XML schema document, and not available
0854 * on the component level as per spec.
0855 */
0856 /**
0857  * XML_SCHEMAS_QUALIF_ELEM:
0858  *
0859  * Reflects elementFormDefault == qualified in
0860  * an XML schema document.
0861  */
0862 #define XML_SCHEMAS_QUALIF_ELEM                1 << 0
0863 /**
0864  * XML_SCHEMAS_QUALIF_ATTR:
0865  *
0866  * Reflects attributeFormDefault == qualified in
0867  * an XML schema document.
0868  */
0869 #define XML_SCHEMAS_QUALIF_ATTR            1 << 1
0870 /**
0871  * XML_SCHEMAS_FINAL_DEFAULT_EXTENSION:
0872  *
0873  * the schema has "extension" in the set of finalDefault.
0874  */
0875 #define XML_SCHEMAS_FINAL_DEFAULT_EXTENSION        1 << 2
0876 /**
0877  * XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION:
0878  *
0879  * the schema has "restriction" in the set of finalDefault.
0880  */
0881 #define XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION            1 << 3
0882 /**
0883  * XML_SCHEMAS_FINAL_DEFAULT_LIST:
0884  *
0885  * the schema has "list" in the set of finalDefault.
0886  */
0887 #define XML_SCHEMAS_FINAL_DEFAULT_LIST            1 << 4
0888 /**
0889  * XML_SCHEMAS_FINAL_DEFAULT_UNION:
0890  *
0891  * the schema has "union" in the set of finalDefault.
0892  */
0893 #define XML_SCHEMAS_FINAL_DEFAULT_UNION            1 << 5
0894 /**
0895  * XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION:
0896  *
0897  * the schema has "extension" in the set of blockDefault.
0898  */
0899 #define XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION            1 << 6
0900 /**
0901  * XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION:
0902  *
0903  * the schema has "restriction" in the set of blockDefault.
0904  */
0905 #define XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION            1 << 7
0906 /**
0907  * XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION:
0908  *
0909  * the schema has "substitution" in the set of blockDefault.
0910  */
0911 #define XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION            1 << 8
0912 /**
0913  * XML_SCHEMAS_INCLUDING_CONVERT_NS:
0914  *
0915  * the schema is currently including an other schema with
0916  * no target namespace.
0917  */
0918 #define XML_SCHEMAS_INCLUDING_CONVERT_NS            1 << 9
0919 /**
0920  * _xmlSchema:
0921  *
0922  * A Schemas definition
0923  */
0924 struct _xmlSchema {
0925     const xmlChar *name; /* schema name */
0926     const xmlChar *targetNamespace; /* the target namespace */
0927     const xmlChar *version;
0928     const xmlChar *id; /* Obsolete */
0929     xmlDocPtr doc;
0930     xmlSchemaAnnotPtr annot;
0931     int flags;
0932 
0933     xmlHashTablePtr typeDecl;
0934     xmlHashTablePtr attrDecl;
0935     xmlHashTablePtr attrgrpDecl;
0936     xmlHashTablePtr elemDecl;
0937     xmlHashTablePtr notaDecl;
0938 
0939     xmlHashTablePtr schemasImports;
0940 
0941     void *_private;        /* unused by the library for users or bindings */
0942     xmlHashTablePtr groupDecl;
0943     xmlDictPtr      dict;
0944     void *includes;     /* the includes, this is opaque for now */
0945     int preserve;        /* whether to free the document */
0946     int counter; /* used to give anonymous components unique names */
0947     xmlHashTablePtr idcDef; /* All identity-constraint defs. */
0948     void *volatiles; /* Obsolete */
0949 };
0950 
0951 XMLPUBFUN void         xmlSchemaFreeType        (xmlSchemaTypePtr type);
0952 XMLPUBFUN void         xmlSchemaFreeWildcard(xmlSchemaWildcardPtr wildcard);
0953 
0954 #ifdef __cplusplus
0955 }
0956 #endif
0957 
0958 #endif /* LIBXML_SCHEMAS_ENABLED */
0959 #endif /* __XML_SCHEMA_INTERNALS_H__ */