Path: blob/master/venv/Lib/site-packages/lxml/includes/libxml/schemasInternals.h
811 views
/*1* Summary: internal interfaces for XML Schemas2* Description: internal interfaces for the XML Schemas handling3* and schema validity checking4* The Schemas development is a Work In Progress.5* Some of those interfaces are not guaranteed to be API or ABI stable !6*7* Copy: See Copyright for the status of this software.8*9* Author: Daniel Veillard10*/111213#ifndef __XML_SCHEMA_INTERNALS_H__14#define __XML_SCHEMA_INTERNALS_H__1516#include <libxml/xmlversion.h>1718#ifdef LIBXML_SCHEMAS_ENABLED1920#include <libxml/xmlregexp.h>21#include <libxml/hash.h>22#include <libxml/dict.h>2324#ifdef __cplusplus25extern "C" {26#endif2728typedef enum {29XML_SCHEMAS_UNKNOWN = 0,30XML_SCHEMAS_STRING = 1,31XML_SCHEMAS_NORMSTRING = 2,32XML_SCHEMAS_DECIMAL = 3,33XML_SCHEMAS_TIME = 4,34XML_SCHEMAS_GDAY = 5,35XML_SCHEMAS_GMONTH = 6,36XML_SCHEMAS_GMONTHDAY = 7,37XML_SCHEMAS_GYEAR = 8,38XML_SCHEMAS_GYEARMONTH = 9,39XML_SCHEMAS_DATE = 10,40XML_SCHEMAS_DATETIME = 11,41XML_SCHEMAS_DURATION = 12,42XML_SCHEMAS_FLOAT = 13,43XML_SCHEMAS_DOUBLE = 14,44XML_SCHEMAS_BOOLEAN = 15,45XML_SCHEMAS_TOKEN = 16,46XML_SCHEMAS_LANGUAGE = 17,47XML_SCHEMAS_NMTOKEN = 18,48XML_SCHEMAS_NMTOKENS = 19,49XML_SCHEMAS_NAME = 20,50XML_SCHEMAS_QNAME = 21,51XML_SCHEMAS_NCNAME = 22,52XML_SCHEMAS_ID = 23,53XML_SCHEMAS_IDREF = 24,54XML_SCHEMAS_IDREFS = 25,55XML_SCHEMAS_ENTITY = 26,56XML_SCHEMAS_ENTITIES = 27,57XML_SCHEMAS_NOTATION = 28,58XML_SCHEMAS_ANYURI = 29,59XML_SCHEMAS_INTEGER = 30,60XML_SCHEMAS_NPINTEGER = 31,61XML_SCHEMAS_NINTEGER = 32,62XML_SCHEMAS_NNINTEGER = 33,63XML_SCHEMAS_PINTEGER = 34,64XML_SCHEMAS_INT = 35,65XML_SCHEMAS_UINT = 36,66XML_SCHEMAS_LONG = 37,67XML_SCHEMAS_ULONG = 38,68XML_SCHEMAS_SHORT = 39,69XML_SCHEMAS_USHORT = 40,70XML_SCHEMAS_BYTE = 41,71XML_SCHEMAS_UBYTE = 42,72XML_SCHEMAS_HEXBINARY = 43,73XML_SCHEMAS_BASE64BINARY = 44,74XML_SCHEMAS_ANYTYPE = 45,75XML_SCHEMAS_ANYSIMPLETYPE = 4676} xmlSchemaValType;7778/*79* XML Schemas defines multiple type of types.80*/81typedef enum {82XML_SCHEMA_TYPE_BASIC = 1, /* A built-in datatype */83XML_SCHEMA_TYPE_ANY,84XML_SCHEMA_TYPE_FACET,85XML_SCHEMA_TYPE_SIMPLE,86XML_SCHEMA_TYPE_COMPLEX,87XML_SCHEMA_TYPE_SEQUENCE = 6,88XML_SCHEMA_TYPE_CHOICE,89XML_SCHEMA_TYPE_ALL,90XML_SCHEMA_TYPE_SIMPLE_CONTENT,91XML_SCHEMA_TYPE_COMPLEX_CONTENT,92XML_SCHEMA_TYPE_UR,93XML_SCHEMA_TYPE_RESTRICTION,94XML_SCHEMA_TYPE_EXTENSION,95XML_SCHEMA_TYPE_ELEMENT,96XML_SCHEMA_TYPE_ATTRIBUTE,97XML_SCHEMA_TYPE_ATTRIBUTEGROUP,98XML_SCHEMA_TYPE_GROUP,99XML_SCHEMA_TYPE_NOTATION,100XML_SCHEMA_TYPE_LIST,101XML_SCHEMA_TYPE_UNION,102XML_SCHEMA_TYPE_ANY_ATTRIBUTE,103XML_SCHEMA_TYPE_IDC_UNIQUE,104XML_SCHEMA_TYPE_IDC_KEY,105XML_SCHEMA_TYPE_IDC_KEYREF,106XML_SCHEMA_TYPE_PARTICLE = 25,107XML_SCHEMA_TYPE_ATTRIBUTE_USE,108XML_SCHEMA_FACET_MININCLUSIVE = 1000,109XML_SCHEMA_FACET_MINEXCLUSIVE,110XML_SCHEMA_FACET_MAXINCLUSIVE,111XML_SCHEMA_FACET_MAXEXCLUSIVE,112XML_SCHEMA_FACET_TOTALDIGITS,113XML_SCHEMA_FACET_FRACTIONDIGITS,114XML_SCHEMA_FACET_PATTERN,115XML_SCHEMA_FACET_ENUMERATION,116XML_SCHEMA_FACET_WHITESPACE,117XML_SCHEMA_FACET_LENGTH,118XML_SCHEMA_FACET_MAXLENGTH,119XML_SCHEMA_FACET_MINLENGTH,120XML_SCHEMA_EXTRA_QNAMEREF = 2000,121XML_SCHEMA_EXTRA_ATTR_USE_PROHIB122} xmlSchemaTypeType;123124typedef enum {125XML_SCHEMA_CONTENT_UNKNOWN = 0,126XML_SCHEMA_CONTENT_EMPTY = 1,127XML_SCHEMA_CONTENT_ELEMENTS,128XML_SCHEMA_CONTENT_MIXED,129XML_SCHEMA_CONTENT_SIMPLE,130XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS, /* Obsolete */131XML_SCHEMA_CONTENT_BASIC,132XML_SCHEMA_CONTENT_ANY133} xmlSchemaContentType;134135typedef struct _xmlSchemaVal xmlSchemaVal;136typedef xmlSchemaVal *xmlSchemaValPtr;137138typedef struct _xmlSchemaType xmlSchemaType;139typedef xmlSchemaType *xmlSchemaTypePtr;140141typedef struct _xmlSchemaFacet xmlSchemaFacet;142typedef xmlSchemaFacet *xmlSchemaFacetPtr;143144/**145* Annotation146*/147typedef struct _xmlSchemaAnnot xmlSchemaAnnot;148typedef xmlSchemaAnnot *xmlSchemaAnnotPtr;149struct _xmlSchemaAnnot {150struct _xmlSchemaAnnot *next;151xmlNodePtr content; /* the annotation */152};153154/**155* XML_SCHEMAS_ANYATTR_SKIP:156*157* Skip unknown attribute from validation158* Obsolete, not used anymore.159*/160#define XML_SCHEMAS_ANYATTR_SKIP 1161/**162* XML_SCHEMAS_ANYATTR_LAX:163*164* Ignore validation non definition on attributes165* Obsolete, not used anymore.166*/167#define XML_SCHEMAS_ANYATTR_LAX 2168/**169* XML_SCHEMAS_ANYATTR_STRICT:170*171* Apply strict validation rules on attributes172* Obsolete, not used anymore.173*/174#define XML_SCHEMAS_ANYATTR_STRICT 3175/**176* XML_SCHEMAS_ANY_SKIP:177*178* Skip unknown attribute from validation179*/180#define XML_SCHEMAS_ANY_SKIP 1181/**182* XML_SCHEMAS_ANY_LAX:183*184* Used by wildcards.185* Validate if type found, don't worry if not found186*/187#define XML_SCHEMAS_ANY_LAX 2188/**189* XML_SCHEMAS_ANY_STRICT:190*191* Used by wildcards.192* Apply strict validation rules193*/194#define XML_SCHEMAS_ANY_STRICT 3195/**196* XML_SCHEMAS_ATTR_USE_PROHIBITED:197*198* Used by wildcards.199* The attribute is prohibited.200*/201#define XML_SCHEMAS_ATTR_USE_PROHIBITED 0202/**203* XML_SCHEMAS_ATTR_USE_REQUIRED:204*205* The attribute is required.206*/207#define XML_SCHEMAS_ATTR_USE_REQUIRED 1208/**209* XML_SCHEMAS_ATTR_USE_OPTIONAL:210*211* The attribute is optional.212*/213#define XML_SCHEMAS_ATTR_USE_OPTIONAL 2214/**215* XML_SCHEMAS_ATTR_GLOBAL:216*217* allow elements in no namespace218*/219#define XML_SCHEMAS_ATTR_GLOBAL 1 << 0220/**221* XML_SCHEMAS_ATTR_NSDEFAULT:222*223* allow elements in no namespace224*/225#define XML_SCHEMAS_ATTR_NSDEFAULT 1 << 7226/**227* XML_SCHEMAS_ATTR_INTERNAL_RESOLVED:228*229* this is set when the "type" and "ref" references230* have been resolved.231*/232#define XML_SCHEMAS_ATTR_INTERNAL_RESOLVED 1 << 8233/**234* XML_SCHEMAS_ATTR_FIXED:235*236* the attribute has a fixed value237*/238#define XML_SCHEMAS_ATTR_FIXED 1 << 9239240/**241* xmlSchemaAttribute:242* An attribute definition.243*/244245typedef struct _xmlSchemaAttribute xmlSchemaAttribute;246typedef xmlSchemaAttribute *xmlSchemaAttributePtr;247struct _xmlSchemaAttribute {248xmlSchemaTypeType type;249struct _xmlSchemaAttribute *next; /* the next attribute (not used?) */250const xmlChar *name; /* the name of the declaration */251const xmlChar *id; /* Deprecated; not used */252const xmlChar *ref; /* Deprecated; not used */253const xmlChar *refNs; /* Deprecated; not used */254const xmlChar *typeName; /* the local name of the type definition */255const xmlChar *typeNs; /* the ns URI of the type definition */256xmlSchemaAnnotPtr annot;257258xmlSchemaTypePtr base; /* Deprecated; not used */259int occurs; /* Deprecated; not used */260const xmlChar *defValue; /* The initial value of the value constraint */261xmlSchemaTypePtr subtypes; /* the type definition */262xmlNodePtr node;263const xmlChar *targetNamespace;264int flags;265const xmlChar *refPrefix; /* Deprecated; not used */266xmlSchemaValPtr defVal; /* The compiled value constraint */267xmlSchemaAttributePtr refDecl; /* Deprecated; not used */268};269270/**271* xmlSchemaAttributeLink:272* Used to build a list of attribute uses on complexType definitions.273* WARNING: Deprecated; not used.274*/275typedef struct _xmlSchemaAttributeLink xmlSchemaAttributeLink;276typedef xmlSchemaAttributeLink *xmlSchemaAttributeLinkPtr;277struct _xmlSchemaAttributeLink {278struct _xmlSchemaAttributeLink *next;/* the next attribute link ... */279struct _xmlSchemaAttribute *attr;/* the linked attribute */280};281282/**283* XML_SCHEMAS_WILDCARD_COMPLETE:284*285* If the wildcard is complete.286*/287#define XML_SCHEMAS_WILDCARD_COMPLETE 1 << 0288289/**290* xmlSchemaCharValueLink:291* Used to build a list of namespaces on wildcards.292*/293typedef struct _xmlSchemaWildcardNs xmlSchemaWildcardNs;294typedef xmlSchemaWildcardNs *xmlSchemaWildcardNsPtr;295struct _xmlSchemaWildcardNs {296struct _xmlSchemaWildcardNs *next;/* the next constraint link ... */297const xmlChar *value;/* the value */298};299300/**301* xmlSchemaWildcard.302* A wildcard.303*/304typedef struct _xmlSchemaWildcard xmlSchemaWildcard;305typedef xmlSchemaWildcard *xmlSchemaWildcardPtr;306struct _xmlSchemaWildcard {307xmlSchemaTypeType type; /* The kind of type */308const xmlChar *id; /* Deprecated; not used */309xmlSchemaAnnotPtr annot;310xmlNodePtr node;311int minOccurs; /* Deprecated; not used */312int maxOccurs; /* Deprecated; not used */313int processContents;314int any; /* Indicates if the ns constraint is of ##any */315xmlSchemaWildcardNsPtr nsSet; /* The list of allowed namespaces */316xmlSchemaWildcardNsPtr negNsSet; /* The negated namespace */317int flags;318};319320/**321* XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED:322*323* The attribute wildcard has been already builded.324*/325#define XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED 1 << 0326/**327* XML_SCHEMAS_ATTRGROUP_GLOBAL:328*329* The attribute wildcard has been already builded.330*/331#define XML_SCHEMAS_ATTRGROUP_GLOBAL 1 << 1332/**333* XML_SCHEMAS_ATTRGROUP_MARKED:334*335* Marks the attr group as marked; used for circular checks.336*/337#define XML_SCHEMAS_ATTRGROUP_MARKED 1 << 2338339/**340* XML_SCHEMAS_ATTRGROUP_REDEFINED:341*342* The attr group was redefined.343*/344#define XML_SCHEMAS_ATTRGROUP_REDEFINED 1 << 3345/**346* XML_SCHEMAS_ATTRGROUP_HAS_REFS:347*348* Whether this attr. group contains attr. group references.349*/350#define XML_SCHEMAS_ATTRGROUP_HAS_REFS 1 << 4351352/**353* An attribute group definition.354*355* xmlSchemaAttribute and xmlSchemaAttributeGroup start of structures356* must be kept similar357*/358typedef struct _xmlSchemaAttributeGroup xmlSchemaAttributeGroup;359typedef xmlSchemaAttributeGroup *xmlSchemaAttributeGroupPtr;360struct _xmlSchemaAttributeGroup {361xmlSchemaTypeType type; /* The kind of type */362struct _xmlSchemaAttribute *next;/* the next attribute if in a group ... */363const xmlChar *name;364const xmlChar *id;365const xmlChar *ref; /* Deprecated; not used */366const xmlChar *refNs; /* Deprecated; not used */367xmlSchemaAnnotPtr annot;368369xmlSchemaAttributePtr attributes; /* Deprecated; not used */370xmlNodePtr node;371int flags;372xmlSchemaWildcardPtr attributeWildcard;373const xmlChar *refPrefix; /* Deprecated; not used */374xmlSchemaAttributeGroupPtr refItem; /* Deprecated; not used */375const xmlChar *targetNamespace;376void *attrUses;377};378379/**380* xmlSchemaTypeLink:381* Used to build a list of types (e.g. member types of382* simpleType with variety "union").383*/384typedef struct _xmlSchemaTypeLink xmlSchemaTypeLink;385typedef xmlSchemaTypeLink *xmlSchemaTypeLinkPtr;386struct _xmlSchemaTypeLink {387struct _xmlSchemaTypeLink *next;/* the next type link ... */388xmlSchemaTypePtr type;/* the linked type */389};390391/**392* xmlSchemaFacetLink:393* Used to build a list of facets.394*/395typedef struct _xmlSchemaFacetLink xmlSchemaFacetLink;396typedef xmlSchemaFacetLink *xmlSchemaFacetLinkPtr;397struct _xmlSchemaFacetLink {398struct _xmlSchemaFacetLink *next;/* the next facet link ... */399xmlSchemaFacetPtr facet;/* the linked facet */400};401402/**403* XML_SCHEMAS_TYPE_MIXED:404*405* the element content type is mixed406*/407#define XML_SCHEMAS_TYPE_MIXED 1 << 0408/**409* XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION:410*411* the simple or complex type has a derivation method of "extension".412*/413#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION 1 << 1414/**415* XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION:416*417* the simple or complex type has a derivation method of "restriction".418*/419#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION 1 << 2420/**421* XML_SCHEMAS_TYPE_GLOBAL:422*423* the type is global424*/425#define XML_SCHEMAS_TYPE_GLOBAL 1 << 3426/**427* XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD:428*429* the complexType owns an attribute wildcard, i.e.430* it can be freed by the complexType431*/432#define XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD 1 << 4 /* Obsolete. */433/**434* XML_SCHEMAS_TYPE_VARIETY_ABSENT:435*436* the simpleType has a variety of "absent".437* TODO: Actually not necessary :-/, since if438* none of the variety flags occur then it's439* automatically absent.440*/441#define XML_SCHEMAS_TYPE_VARIETY_ABSENT 1 << 5442/**443* XML_SCHEMAS_TYPE_VARIETY_LIST:444*445* the simpleType has a variety of "list".446*/447#define XML_SCHEMAS_TYPE_VARIETY_LIST 1 << 6448/**449* XML_SCHEMAS_TYPE_VARIETY_UNION:450*451* the simpleType has a variety of "union".452*/453#define XML_SCHEMAS_TYPE_VARIETY_UNION 1 << 7454/**455* XML_SCHEMAS_TYPE_VARIETY_ATOMIC:456*457* the simpleType has a variety of "union".458*/459#define XML_SCHEMAS_TYPE_VARIETY_ATOMIC 1 << 8460/**461* XML_SCHEMAS_TYPE_FINAL_EXTENSION:462*463* the complexType has a final of "extension".464*/465#define XML_SCHEMAS_TYPE_FINAL_EXTENSION 1 << 9466/**467* XML_SCHEMAS_TYPE_FINAL_RESTRICTION:468*469* the simpleType/complexType has a final of "restriction".470*/471#define XML_SCHEMAS_TYPE_FINAL_RESTRICTION 1 << 10472/**473* XML_SCHEMAS_TYPE_FINAL_LIST:474*475* the simpleType has a final of "list".476*/477#define XML_SCHEMAS_TYPE_FINAL_LIST 1 << 11478/**479* XML_SCHEMAS_TYPE_FINAL_UNION:480*481* the simpleType has a final of "union".482*/483#define XML_SCHEMAS_TYPE_FINAL_UNION 1 << 12484/**485* XML_SCHEMAS_TYPE_FINAL_DEFAULT:486*487* the simpleType has a final of "default".488*/489#define XML_SCHEMAS_TYPE_FINAL_DEFAULT 1 << 13490/**491* XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE:492*493* Marks the item as a builtin primitive.494*/495#define XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE 1 << 14496/**497* XML_SCHEMAS_TYPE_MARKED:498*499* Marks the item as marked; used for circular checks.500*/501#define XML_SCHEMAS_TYPE_MARKED 1 << 16502/**503* XML_SCHEMAS_TYPE_BLOCK_DEFAULT:504*505* the complexType did not specify 'block' so use the default of the506* <schema> item.507*/508#define XML_SCHEMAS_TYPE_BLOCK_DEFAULT 1 << 17509/**510* XML_SCHEMAS_TYPE_BLOCK_EXTENSION:511*512* the complexType has a 'block' of "extension".513*/514#define XML_SCHEMAS_TYPE_BLOCK_EXTENSION 1 << 18515/**516* XML_SCHEMAS_TYPE_BLOCK_RESTRICTION:517*518* the complexType has a 'block' of "restriction".519*/520#define XML_SCHEMAS_TYPE_BLOCK_RESTRICTION 1 << 19521/**522* XML_SCHEMAS_TYPE_ABSTRACT:523*524* the simple/complexType is abstract.525*/526#define XML_SCHEMAS_TYPE_ABSTRACT 1 << 20527/**528* XML_SCHEMAS_TYPE_FACETSNEEDVALUE:529*530* indicates if the facets need a computed value531*/532#define XML_SCHEMAS_TYPE_FACETSNEEDVALUE 1 << 21533/**534* XML_SCHEMAS_TYPE_INTERNAL_RESOLVED:535*536* indicates that the type was typefixed537*/538#define XML_SCHEMAS_TYPE_INTERNAL_RESOLVED 1 << 22539/**540* XML_SCHEMAS_TYPE_INTERNAL_INVALID:541*542* indicates that the type is invalid543*/544#define XML_SCHEMAS_TYPE_INTERNAL_INVALID 1 << 23545/**546* XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE:547*548* a whitespace-facet value of "preserve"549*/550#define XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE 1 << 24551/**552* XML_SCHEMAS_TYPE_WHITESPACE_REPLACE:553*554* a whitespace-facet value of "replace"555*/556#define XML_SCHEMAS_TYPE_WHITESPACE_REPLACE 1 << 25557/**558* XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE:559*560* a whitespace-facet value of "collapse"561*/562#define XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE 1 << 26563/**564* XML_SCHEMAS_TYPE_HAS_FACETS:565*566* has facets567*/568#define XML_SCHEMAS_TYPE_HAS_FACETS 1 << 27569/**570* XML_SCHEMAS_TYPE_NORMVALUENEEDED:571*572* indicates if the facets (pattern) need a normalized value573*/574#define XML_SCHEMAS_TYPE_NORMVALUENEEDED 1 << 28575576/**577* XML_SCHEMAS_TYPE_FIXUP_1:578*579* First stage of fixup was done.580*/581#define XML_SCHEMAS_TYPE_FIXUP_1 1 << 29582583/**584* XML_SCHEMAS_TYPE_REDEFINED:585*586* The type was redefined.587*/588#define XML_SCHEMAS_TYPE_REDEFINED 1 << 30589/**590* XML_SCHEMAS_TYPE_REDEFINING:591*592* The type redefines an other type.593*/594/* #define XML_SCHEMAS_TYPE_REDEFINING 1 << 31 */595596/**597* _xmlSchemaType:598*599* Schemas type definition.600*/601struct _xmlSchemaType {602xmlSchemaTypeType type; /* The kind of type */603struct _xmlSchemaType *next; /* the next type if in a sequence ... */604const xmlChar *name;605const xmlChar *id ; /* Deprecated; not used */606const xmlChar *ref; /* Deprecated; not used */607const xmlChar *refNs; /* Deprecated; not used */608xmlSchemaAnnotPtr annot;609xmlSchemaTypePtr subtypes;610xmlSchemaAttributePtr attributes; /* Deprecated; not used */611xmlNodePtr node;612int minOccurs; /* Deprecated; not used */613int maxOccurs; /* Deprecated; not used */614615int flags;616xmlSchemaContentType contentType;617const xmlChar *base; /* Base type's local name */618const xmlChar *baseNs; /* Base type's target namespace */619xmlSchemaTypePtr baseType; /* The base type component */620xmlSchemaFacetPtr facets; /* Local facets */621struct _xmlSchemaType *redef; /* Deprecated; not used */622int recurse; /* Obsolete */623xmlSchemaAttributeLinkPtr *attributeUses; /* Deprecated; not used */624xmlSchemaWildcardPtr attributeWildcard;625int builtInType; /* Type of built-in types. */626xmlSchemaTypeLinkPtr memberTypes; /* member-types if a union type. */627xmlSchemaFacetLinkPtr facetSet; /* All facets (incl. inherited) */628const xmlChar *refPrefix; /* Deprecated; not used */629xmlSchemaTypePtr contentTypeDef; /* Used for the simple content of complex types.630Could we use @subtypes for this? */631xmlRegexpPtr contModel; /* Holds the automaton of the content model */632const xmlChar *targetNamespace;633void *attrUses;634};635636/*637* xmlSchemaElement:638* An element definition.639*640* xmlSchemaType, xmlSchemaFacet and xmlSchemaElement start of641* structures must be kept similar642*/643/**644* XML_SCHEMAS_ELEM_NILLABLE:645*646* the element is nillable647*/648#define XML_SCHEMAS_ELEM_NILLABLE 1 << 0649/**650* XML_SCHEMAS_ELEM_GLOBAL:651*652* the element is global653*/654#define XML_SCHEMAS_ELEM_GLOBAL 1 << 1655/**656* XML_SCHEMAS_ELEM_DEFAULT:657*658* the element has a default value659*/660#define XML_SCHEMAS_ELEM_DEFAULT 1 << 2661/**662* XML_SCHEMAS_ELEM_FIXED:663*664* the element has a fixed value665*/666#define XML_SCHEMAS_ELEM_FIXED 1 << 3667/**668* XML_SCHEMAS_ELEM_ABSTRACT:669*670* the element is abstract671*/672#define XML_SCHEMAS_ELEM_ABSTRACT 1 << 4673/**674* XML_SCHEMAS_ELEM_TOPLEVEL:675*676* the element is top level677* obsolete: use XML_SCHEMAS_ELEM_GLOBAL instead678*/679#define XML_SCHEMAS_ELEM_TOPLEVEL 1 << 5680/**681* XML_SCHEMAS_ELEM_REF:682*683* the element is a reference to a type684*/685#define XML_SCHEMAS_ELEM_REF 1 << 6686/**687* XML_SCHEMAS_ELEM_NSDEFAULT:688*689* allow elements in no namespace690* Obsolete, not used anymore.691*/692#define XML_SCHEMAS_ELEM_NSDEFAULT 1 << 7693/**694* XML_SCHEMAS_ELEM_INTERNAL_RESOLVED:695*696* this is set when "type", "ref", "substitutionGroup"697* references have been resolved.698*/699#define XML_SCHEMAS_ELEM_INTERNAL_RESOLVED 1 << 8700/**701* XML_SCHEMAS_ELEM_CIRCULAR:702*703* a helper flag for the search of circular references.704*/705#define XML_SCHEMAS_ELEM_CIRCULAR 1 << 9706/**707* XML_SCHEMAS_ELEM_BLOCK_ABSENT:708*709* the "block" attribute is absent710*/711#define XML_SCHEMAS_ELEM_BLOCK_ABSENT 1 << 10712/**713* XML_SCHEMAS_ELEM_BLOCK_EXTENSION:714*715* disallowed substitutions are absent716*/717#define XML_SCHEMAS_ELEM_BLOCK_EXTENSION 1 << 11718/**719* XML_SCHEMAS_ELEM_BLOCK_RESTRICTION:720*721* disallowed substitutions: "restriction"722*/723#define XML_SCHEMAS_ELEM_BLOCK_RESTRICTION 1 << 12724/**725* XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION:726*727* disallowed substitutions: "substituion"728*/729#define XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION 1 << 13730/**731* XML_SCHEMAS_ELEM_FINAL_ABSENT:732*733* substitution group exclusions are absent734*/735#define XML_SCHEMAS_ELEM_FINAL_ABSENT 1 << 14736/**737* XML_SCHEMAS_ELEM_FINAL_EXTENSION:738*739* substitution group exclusions: "extension"740*/741#define XML_SCHEMAS_ELEM_FINAL_EXTENSION 1 << 15742/**743* XML_SCHEMAS_ELEM_FINAL_RESTRICTION:744*745* substitution group exclusions: "restriction"746*/747#define XML_SCHEMAS_ELEM_FINAL_RESTRICTION 1 << 16748/**749* XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD:750*751* the declaration is a substitution group head752*/753#define XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD 1 << 17754/**755* XML_SCHEMAS_ELEM_INTERNAL_CHECKED:756*757* this is set when the elem decl has been checked against758* all constraints759*/760#define XML_SCHEMAS_ELEM_INTERNAL_CHECKED 1 << 18761762typedef struct _xmlSchemaElement xmlSchemaElement;763typedef xmlSchemaElement *xmlSchemaElementPtr;764struct _xmlSchemaElement {765xmlSchemaTypeType type; /* The kind of type */766struct _xmlSchemaType *next; /* Not used? */767const xmlChar *name;768const xmlChar *id; /* Deprecated; not used */769const xmlChar *ref; /* Deprecated; not used */770const xmlChar *refNs; /* Deprecated; not used */771xmlSchemaAnnotPtr annot;772xmlSchemaTypePtr subtypes; /* the type definition */773xmlSchemaAttributePtr attributes;774xmlNodePtr node;775int minOccurs; /* Deprecated; not used */776int maxOccurs; /* Deprecated; not used */777778int flags;779const xmlChar *targetNamespace;780const xmlChar *namedType;781const xmlChar *namedTypeNs;782const xmlChar *substGroup;783const xmlChar *substGroupNs;784const xmlChar *scope;785const xmlChar *value; /* The original value of the value constraint. */786struct _xmlSchemaElement *refDecl; /* This will now be used for the787substitution group affiliation */788xmlRegexpPtr contModel; /* Obsolete for WXS, maybe used for RelaxNG */789xmlSchemaContentType contentType;790const xmlChar *refPrefix; /* Deprecated; not used */791xmlSchemaValPtr defVal; /* The compiled value contraint. */792void *idcs; /* The identity-constraint defs */793};794795/*796* XML_SCHEMAS_FACET_UNKNOWN:797*798* unknown facet handling799*/800#define XML_SCHEMAS_FACET_UNKNOWN 0801/*802* XML_SCHEMAS_FACET_PRESERVE:803*804* preserve the type of the facet805*/806#define XML_SCHEMAS_FACET_PRESERVE 1807/*808* XML_SCHEMAS_FACET_REPLACE:809*810* replace the type of the facet811*/812#define XML_SCHEMAS_FACET_REPLACE 2813/*814* XML_SCHEMAS_FACET_COLLAPSE:815*816* collapse the types of the facet817*/818#define XML_SCHEMAS_FACET_COLLAPSE 3819/**820* A facet definition.821*/822struct _xmlSchemaFacet {823xmlSchemaTypeType type; /* The kind of type */824struct _xmlSchemaFacet *next;/* the next type if in a sequence ... */825const xmlChar *value; /* The original value */826const xmlChar *id; /* Obsolete */827xmlSchemaAnnotPtr annot;828xmlNodePtr node;829int fixed; /* XML_SCHEMAS_FACET_PRESERVE, etc. */830int whitespace;831xmlSchemaValPtr val; /* The compiled value */832xmlRegexpPtr regexp; /* The regex for patterns */833};834835/**836* A notation definition.837*/838typedef struct _xmlSchemaNotation xmlSchemaNotation;839typedef xmlSchemaNotation *xmlSchemaNotationPtr;840struct _xmlSchemaNotation {841xmlSchemaTypeType type; /* The kind of type */842const xmlChar *name;843xmlSchemaAnnotPtr annot;844const xmlChar *identifier;845const xmlChar *targetNamespace;846};847848/*849* TODO: Actually all those flags used for the schema should sit850* on the schema parser context, since they are used only851* during parsing an XML schema document, and not available852* on the component level as per spec.853*/854/**855* XML_SCHEMAS_QUALIF_ELEM:856*857* Reflects elementFormDefault == qualified in858* an XML schema document.859*/860#define XML_SCHEMAS_QUALIF_ELEM 1 << 0861/**862* XML_SCHEMAS_QUALIF_ATTR:863*864* Reflects attributeFormDefault == qualified in865* an XML schema document.866*/867#define XML_SCHEMAS_QUALIF_ATTR 1 << 1868/**869* XML_SCHEMAS_FINAL_DEFAULT_EXTENSION:870*871* the schema has "extension" in the set of finalDefault.872*/873#define XML_SCHEMAS_FINAL_DEFAULT_EXTENSION 1 << 2874/**875* XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION:876*877* the schema has "restriction" in the set of finalDefault.878*/879#define XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION 1 << 3880/**881* XML_SCHEMAS_FINAL_DEFAULT_LIST:882*883* the cshema has "list" in the set of finalDefault.884*/885#define XML_SCHEMAS_FINAL_DEFAULT_LIST 1 << 4886/**887* XML_SCHEMAS_FINAL_DEFAULT_UNION:888*889* the schema has "union" in the set of finalDefault.890*/891#define XML_SCHEMAS_FINAL_DEFAULT_UNION 1 << 5892/**893* XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION:894*895* the schema has "extension" in the set of blockDefault.896*/897#define XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION 1 << 6898/**899* XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION:900*901* the schema has "restriction" in the set of blockDefault.902*/903#define XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION 1 << 7904/**905* XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION:906*907* the schema has "substitution" in the set of blockDefault.908*/909#define XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION 1 << 8910/**911* XML_SCHEMAS_INCLUDING_CONVERT_NS:912*913* the schema is currently including an other schema with914* no target namespace.915*/916#define XML_SCHEMAS_INCLUDING_CONVERT_NS 1 << 9917/**918* _xmlSchema:919*920* A Schemas definition921*/922struct _xmlSchema {923const xmlChar *name; /* schema name */924const xmlChar *targetNamespace; /* the target namespace */925const xmlChar *version;926const xmlChar *id; /* Obsolete */927xmlDocPtr doc;928xmlSchemaAnnotPtr annot;929int flags;930931xmlHashTablePtr typeDecl;932xmlHashTablePtr attrDecl;933xmlHashTablePtr attrgrpDecl;934xmlHashTablePtr elemDecl;935xmlHashTablePtr notaDecl;936937xmlHashTablePtr schemasImports;938939void *_private; /* unused by the library for users or bindings */940xmlHashTablePtr groupDecl;941xmlDictPtr dict;942void *includes; /* the includes, this is opaque for now */943int preserve; /* whether to free the document */944int counter; /* used to give ononymous components unique names */945xmlHashTablePtr idcDef; /* All identity-constraint defs. */946void *volatiles; /* Obsolete */947};948949XMLPUBFUN void XMLCALL xmlSchemaFreeType (xmlSchemaTypePtr type);950XMLPUBFUN void XMLCALL xmlSchemaFreeWildcard(xmlSchemaWildcardPtr wildcard);951952#ifdef __cplusplus953}954#endif955956#endif /* LIBXML_SCHEMAS_ENABLED */957#endif /* __XML_SCHEMA_INTERNALS_H__ */958959960