Path: blob/master/libs/xml2/include/libxml/schemasInternals.h
4394 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>23#include <libxml/tree.h>2425#ifdef __cplusplus26extern "C" {27#endif2829typedef enum {30XML_SCHEMAS_UNKNOWN = 0,31XML_SCHEMAS_STRING = 1,32XML_SCHEMAS_NORMSTRING = 2,33XML_SCHEMAS_DECIMAL = 3,34XML_SCHEMAS_TIME = 4,35XML_SCHEMAS_GDAY = 5,36XML_SCHEMAS_GMONTH = 6,37XML_SCHEMAS_GMONTHDAY = 7,38XML_SCHEMAS_GYEAR = 8,39XML_SCHEMAS_GYEARMONTH = 9,40XML_SCHEMAS_DATE = 10,41XML_SCHEMAS_DATETIME = 11,42XML_SCHEMAS_DURATION = 12,43XML_SCHEMAS_FLOAT = 13,44XML_SCHEMAS_DOUBLE = 14,45XML_SCHEMAS_BOOLEAN = 15,46XML_SCHEMAS_TOKEN = 16,47XML_SCHEMAS_LANGUAGE = 17,48XML_SCHEMAS_NMTOKEN = 18,49XML_SCHEMAS_NMTOKENS = 19,50XML_SCHEMAS_NAME = 20,51XML_SCHEMAS_QNAME = 21,52XML_SCHEMAS_NCNAME = 22,53XML_SCHEMAS_ID = 23,54XML_SCHEMAS_IDREF = 24,55XML_SCHEMAS_IDREFS = 25,56XML_SCHEMAS_ENTITY = 26,57XML_SCHEMAS_ENTITIES = 27,58XML_SCHEMAS_NOTATION = 28,59XML_SCHEMAS_ANYURI = 29,60XML_SCHEMAS_INTEGER = 30,61XML_SCHEMAS_NPINTEGER = 31,62XML_SCHEMAS_NINTEGER = 32,63XML_SCHEMAS_NNINTEGER = 33,64XML_SCHEMAS_PINTEGER = 34,65XML_SCHEMAS_INT = 35,66XML_SCHEMAS_UINT = 36,67XML_SCHEMAS_LONG = 37,68XML_SCHEMAS_ULONG = 38,69XML_SCHEMAS_SHORT = 39,70XML_SCHEMAS_USHORT = 40,71XML_SCHEMAS_BYTE = 41,72XML_SCHEMAS_UBYTE = 42,73XML_SCHEMAS_HEXBINARY = 43,74XML_SCHEMAS_BASE64BINARY = 44,75XML_SCHEMAS_ANYTYPE = 45,76XML_SCHEMAS_ANYSIMPLETYPE = 4677} xmlSchemaValType;7879/*80* XML Schemas defines multiple type of types.81*/82typedef enum {83XML_SCHEMA_TYPE_BASIC = 1, /* A built-in datatype */84XML_SCHEMA_TYPE_ANY,85XML_SCHEMA_TYPE_FACET,86XML_SCHEMA_TYPE_SIMPLE,87XML_SCHEMA_TYPE_COMPLEX,88XML_SCHEMA_TYPE_SEQUENCE = 6,89XML_SCHEMA_TYPE_CHOICE,90XML_SCHEMA_TYPE_ALL,91XML_SCHEMA_TYPE_SIMPLE_CONTENT,92XML_SCHEMA_TYPE_COMPLEX_CONTENT,93XML_SCHEMA_TYPE_UR,94XML_SCHEMA_TYPE_RESTRICTION,95XML_SCHEMA_TYPE_EXTENSION,96XML_SCHEMA_TYPE_ELEMENT,97XML_SCHEMA_TYPE_ATTRIBUTE,98XML_SCHEMA_TYPE_ATTRIBUTEGROUP,99XML_SCHEMA_TYPE_GROUP,100XML_SCHEMA_TYPE_NOTATION,101XML_SCHEMA_TYPE_LIST,102XML_SCHEMA_TYPE_UNION,103XML_SCHEMA_TYPE_ANY_ATTRIBUTE,104XML_SCHEMA_TYPE_IDC_UNIQUE,105XML_SCHEMA_TYPE_IDC_KEY,106XML_SCHEMA_TYPE_IDC_KEYREF,107XML_SCHEMA_TYPE_PARTICLE = 25,108XML_SCHEMA_TYPE_ATTRIBUTE_USE,109XML_SCHEMA_FACET_MININCLUSIVE = 1000,110XML_SCHEMA_FACET_MINEXCLUSIVE,111XML_SCHEMA_FACET_MAXINCLUSIVE,112XML_SCHEMA_FACET_MAXEXCLUSIVE,113XML_SCHEMA_FACET_TOTALDIGITS,114XML_SCHEMA_FACET_FRACTIONDIGITS,115XML_SCHEMA_FACET_PATTERN,116XML_SCHEMA_FACET_ENUMERATION,117XML_SCHEMA_FACET_WHITESPACE,118XML_SCHEMA_FACET_LENGTH,119XML_SCHEMA_FACET_MAXLENGTH,120XML_SCHEMA_FACET_MINLENGTH,121XML_SCHEMA_EXTRA_QNAMEREF = 2000,122XML_SCHEMA_EXTRA_ATTR_USE_PROHIB123} xmlSchemaTypeType;124125typedef enum {126XML_SCHEMA_CONTENT_UNKNOWN = 0,127XML_SCHEMA_CONTENT_EMPTY = 1,128XML_SCHEMA_CONTENT_ELEMENTS,129XML_SCHEMA_CONTENT_MIXED,130XML_SCHEMA_CONTENT_SIMPLE,131XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS, /* Obsolete */132XML_SCHEMA_CONTENT_BASIC,133XML_SCHEMA_CONTENT_ANY134} xmlSchemaContentType;135136typedef struct _xmlSchemaVal xmlSchemaVal;137typedef xmlSchemaVal *xmlSchemaValPtr;138139typedef struct _xmlSchemaType xmlSchemaType;140typedef xmlSchemaType *xmlSchemaTypePtr;141142typedef struct _xmlSchemaFacet xmlSchemaFacet;143typedef xmlSchemaFacet *xmlSchemaFacetPtr;144145/**146* Annotation147*/148typedef struct _xmlSchemaAnnot xmlSchemaAnnot;149typedef xmlSchemaAnnot *xmlSchemaAnnotPtr;150struct _xmlSchemaAnnot {151struct _xmlSchemaAnnot *next;152xmlNodePtr content; /* the annotation */153};154155/**156* XML_SCHEMAS_ANYATTR_SKIP:157*158* Skip unknown attribute from validation159* Obsolete, not used anymore.160*/161#define XML_SCHEMAS_ANYATTR_SKIP 1162/**163* XML_SCHEMAS_ANYATTR_LAX:164*165* Ignore validation non definition on attributes166* Obsolete, not used anymore.167*/168#define XML_SCHEMAS_ANYATTR_LAX 2169/**170* XML_SCHEMAS_ANYATTR_STRICT:171*172* Apply strict validation rules on attributes173* Obsolete, not used anymore.174*/175#define XML_SCHEMAS_ANYATTR_STRICT 3176/**177* XML_SCHEMAS_ANY_SKIP:178*179* Skip unknown attribute from validation180*/181#define XML_SCHEMAS_ANY_SKIP 1182/**183* XML_SCHEMAS_ANY_LAX:184*185* Used by wildcards.186* Validate if type found, don't worry if not found187*/188#define XML_SCHEMAS_ANY_LAX 2189/**190* XML_SCHEMAS_ANY_STRICT:191*192* Used by wildcards.193* Apply strict validation rules194*/195#define XML_SCHEMAS_ANY_STRICT 3196/**197* XML_SCHEMAS_ATTR_USE_PROHIBITED:198*199* Used by wildcards.200* The attribute is prohibited.201*/202#define XML_SCHEMAS_ATTR_USE_PROHIBITED 0203/**204* XML_SCHEMAS_ATTR_USE_REQUIRED:205*206* The attribute is required.207*/208#define XML_SCHEMAS_ATTR_USE_REQUIRED 1209/**210* XML_SCHEMAS_ATTR_USE_OPTIONAL:211*212* The attribute is optional.213*/214#define XML_SCHEMAS_ATTR_USE_OPTIONAL 2215/**216* XML_SCHEMAS_ATTR_GLOBAL:217*218* allow elements in no namespace219*/220#define XML_SCHEMAS_ATTR_GLOBAL 1 << 0221/**222* XML_SCHEMAS_ATTR_NSDEFAULT:223*224* allow elements in no namespace225*/226#define XML_SCHEMAS_ATTR_NSDEFAULT 1 << 7227/**228* XML_SCHEMAS_ATTR_INTERNAL_RESOLVED:229*230* this is set when the "type" and "ref" references231* have been resolved.232*/233#define XML_SCHEMAS_ATTR_INTERNAL_RESOLVED 1 << 8234/**235* XML_SCHEMAS_ATTR_FIXED:236*237* the attribute has a fixed value238*/239#define XML_SCHEMAS_ATTR_FIXED 1 << 9240241/**242* xmlSchemaAttribute:243* An attribute definition.244*/245246typedef struct _xmlSchemaAttribute xmlSchemaAttribute;247typedef xmlSchemaAttribute *xmlSchemaAttributePtr;248struct _xmlSchemaAttribute {249xmlSchemaTypeType type;250struct _xmlSchemaAttribute *next; /* the next attribute (not used?) */251const xmlChar *name; /* the name of the declaration */252const xmlChar *id; /* Deprecated; not used */253const xmlChar *ref; /* Deprecated; not used */254const xmlChar *refNs; /* Deprecated; not used */255const xmlChar *typeName; /* the local name of the type definition */256const xmlChar *typeNs; /* the ns URI of the type definition */257xmlSchemaAnnotPtr annot;258259xmlSchemaTypePtr base; /* Deprecated; not used */260int occurs; /* Deprecated; not used */261const xmlChar *defValue; /* The initial value of the value constraint */262xmlSchemaTypePtr subtypes; /* the type definition */263xmlNodePtr node;264const xmlChar *targetNamespace;265int flags;266const xmlChar *refPrefix; /* Deprecated; not used */267xmlSchemaValPtr defVal; /* The compiled value constraint */268xmlSchemaAttributePtr refDecl; /* Deprecated; not used */269};270271/**272* xmlSchemaAttributeLink:273* Used to build a list of attribute uses on complexType definitions.274* WARNING: Deprecated; not used.275*/276typedef struct _xmlSchemaAttributeLink xmlSchemaAttributeLink;277typedef xmlSchemaAttributeLink *xmlSchemaAttributeLinkPtr;278struct _xmlSchemaAttributeLink {279struct _xmlSchemaAttributeLink *next;/* the next attribute link ... */280struct _xmlSchemaAttribute *attr;/* the linked attribute */281};282283/**284* XML_SCHEMAS_WILDCARD_COMPLETE:285*286* If the wildcard is complete.287*/288#define XML_SCHEMAS_WILDCARD_COMPLETE 1 << 0289290/**291* xmlSchemaCharValueLink:292* Used to build a list of namespaces on wildcards.293*/294typedef struct _xmlSchemaWildcardNs xmlSchemaWildcardNs;295typedef xmlSchemaWildcardNs *xmlSchemaWildcardNsPtr;296struct _xmlSchemaWildcardNs {297struct _xmlSchemaWildcardNs *next;/* the next constraint link ... */298const xmlChar *value;/* the value */299};300301/**302* xmlSchemaWildcard.303* A wildcard.304*/305typedef struct _xmlSchemaWildcard xmlSchemaWildcard;306typedef xmlSchemaWildcard *xmlSchemaWildcardPtr;307struct _xmlSchemaWildcard {308xmlSchemaTypeType type; /* The kind of type */309const xmlChar *id; /* Deprecated; not used */310xmlSchemaAnnotPtr annot;311xmlNodePtr node;312int minOccurs; /* Deprecated; not used */313int maxOccurs; /* Deprecated; not used */314int processContents;315int any; /* Indicates if the ns constraint is of ##any */316xmlSchemaWildcardNsPtr nsSet; /* The list of allowed namespaces */317xmlSchemaWildcardNsPtr negNsSet; /* The negated namespace */318int flags;319};320321/**322* XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED:323*324* The attribute wildcard has been built.325*/326#define XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED 1 << 0327/**328* XML_SCHEMAS_ATTRGROUP_GLOBAL:329*330* The attribute group has been defined.331*/332#define XML_SCHEMAS_ATTRGROUP_GLOBAL 1 << 1333/**334* XML_SCHEMAS_ATTRGROUP_MARKED:335*336* Marks the attr group as marked; used for circular checks.337*/338#define XML_SCHEMAS_ATTRGROUP_MARKED 1 << 2339340/**341* XML_SCHEMAS_ATTRGROUP_REDEFINED:342*343* The attr group was redefined.344*/345#define XML_SCHEMAS_ATTRGROUP_REDEFINED 1 << 3346/**347* XML_SCHEMAS_ATTRGROUP_HAS_REFS:348*349* Whether this attr. group contains attr. group references.350*/351#define XML_SCHEMAS_ATTRGROUP_HAS_REFS 1 << 4352353/**354* An attribute group definition.355*356* xmlSchemaAttribute and xmlSchemaAttributeGroup start of structures357* must be kept similar358*/359typedef struct _xmlSchemaAttributeGroup xmlSchemaAttributeGroup;360typedef xmlSchemaAttributeGroup *xmlSchemaAttributeGroupPtr;361struct _xmlSchemaAttributeGroup {362xmlSchemaTypeType type; /* The kind of type */363struct _xmlSchemaAttribute *next;/* the next attribute if in a group ... */364const xmlChar *name;365const xmlChar *id;366const xmlChar *ref; /* Deprecated; not used */367const xmlChar *refNs; /* Deprecated; not used */368xmlSchemaAnnotPtr annot;369370xmlSchemaAttributePtr attributes; /* Deprecated; not used */371xmlNodePtr node;372int flags;373xmlSchemaWildcardPtr attributeWildcard;374const xmlChar *refPrefix; /* Deprecated; not used */375xmlSchemaAttributeGroupPtr refItem; /* Deprecated; not used */376const xmlChar *targetNamespace;377void *attrUses;378};379380/**381* xmlSchemaTypeLink:382* Used to build a list of types (e.g. member types of383* simpleType with variety "union").384*/385typedef struct _xmlSchemaTypeLink xmlSchemaTypeLink;386typedef xmlSchemaTypeLink *xmlSchemaTypeLinkPtr;387struct _xmlSchemaTypeLink {388struct _xmlSchemaTypeLink *next;/* the next type link ... */389xmlSchemaTypePtr type;/* the linked type */390};391392/**393* xmlSchemaFacetLink:394* Used to build a list of facets.395*/396typedef struct _xmlSchemaFacetLink xmlSchemaFacetLink;397typedef xmlSchemaFacetLink *xmlSchemaFacetLinkPtr;398struct _xmlSchemaFacetLink {399struct _xmlSchemaFacetLink *next;/* the next facet link ... */400xmlSchemaFacetPtr facet;/* the linked facet */401};402403/**404* XML_SCHEMAS_TYPE_MIXED:405*406* the element content type is mixed407*/408#define XML_SCHEMAS_TYPE_MIXED 1 << 0409/**410* XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION:411*412* the simple or complex type has a derivation method of "extension".413*/414#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION 1 << 1415/**416* XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION:417*418* the simple or complex type has a derivation method of "restriction".419*/420#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION 1 << 2421/**422* XML_SCHEMAS_TYPE_GLOBAL:423*424* the type is global425*/426#define XML_SCHEMAS_TYPE_GLOBAL 1 << 3427/**428* XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD:429*430* the complexType owns an attribute wildcard, i.e.431* it can be freed by the complexType432*/433#define XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD 1 << 4 /* Obsolete. */434/**435* XML_SCHEMAS_TYPE_VARIETY_ABSENT:436*437* the simpleType has a variety of "absent".438* TODO: Actually not necessary :-/, since if439* none of the variety flags occur then it's440* automatically absent.441*/442#define XML_SCHEMAS_TYPE_VARIETY_ABSENT 1 << 5443/**444* XML_SCHEMAS_TYPE_VARIETY_LIST:445*446* the simpleType has a variety of "list".447*/448#define XML_SCHEMAS_TYPE_VARIETY_LIST 1 << 6449/**450* XML_SCHEMAS_TYPE_VARIETY_UNION:451*452* the simpleType has a variety of "union".453*/454#define XML_SCHEMAS_TYPE_VARIETY_UNION 1 << 7455/**456* XML_SCHEMAS_TYPE_VARIETY_ATOMIC:457*458* the simpleType has a variety of "union".459*/460#define XML_SCHEMAS_TYPE_VARIETY_ATOMIC 1 << 8461/**462* XML_SCHEMAS_TYPE_FINAL_EXTENSION:463*464* the complexType has a final of "extension".465*/466#define XML_SCHEMAS_TYPE_FINAL_EXTENSION 1 << 9467/**468* XML_SCHEMAS_TYPE_FINAL_RESTRICTION:469*470* the simpleType/complexType has a final of "restriction".471*/472#define XML_SCHEMAS_TYPE_FINAL_RESTRICTION 1 << 10473/**474* XML_SCHEMAS_TYPE_FINAL_LIST:475*476* the simpleType has a final of "list".477*/478#define XML_SCHEMAS_TYPE_FINAL_LIST 1 << 11479/**480* XML_SCHEMAS_TYPE_FINAL_UNION:481*482* the simpleType has a final of "union".483*/484#define XML_SCHEMAS_TYPE_FINAL_UNION 1 << 12485/**486* XML_SCHEMAS_TYPE_FINAL_DEFAULT:487*488* the simpleType has a final of "default".489*/490#define XML_SCHEMAS_TYPE_FINAL_DEFAULT 1 << 13491/**492* XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE:493*494* Marks the item as a builtin primitive.495*/496#define XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE 1 << 14497/**498* XML_SCHEMAS_TYPE_MARKED:499*500* Marks the item as marked; used for circular checks.501*/502#define XML_SCHEMAS_TYPE_MARKED 1 << 16503/**504* XML_SCHEMAS_TYPE_BLOCK_DEFAULT:505*506* the complexType did not specify 'block' so use the default of the507* <schema> item.508*/509#define XML_SCHEMAS_TYPE_BLOCK_DEFAULT 1 << 17510/**511* XML_SCHEMAS_TYPE_BLOCK_EXTENSION:512*513* the complexType has a 'block' of "extension".514*/515#define XML_SCHEMAS_TYPE_BLOCK_EXTENSION 1 << 18516/**517* XML_SCHEMAS_TYPE_BLOCK_RESTRICTION:518*519* the complexType has a 'block' of "restriction".520*/521#define XML_SCHEMAS_TYPE_BLOCK_RESTRICTION 1 << 19522/**523* XML_SCHEMAS_TYPE_ABSTRACT:524*525* the simple/complexType is abstract.526*/527#define XML_SCHEMAS_TYPE_ABSTRACT 1 << 20528/**529* XML_SCHEMAS_TYPE_FACETSNEEDVALUE:530*531* indicates if the facets need a computed value532*/533#define XML_SCHEMAS_TYPE_FACETSNEEDVALUE 1 << 21534/**535* XML_SCHEMAS_TYPE_INTERNAL_RESOLVED:536*537* indicates that the type was typefixed538*/539#define XML_SCHEMAS_TYPE_INTERNAL_RESOLVED 1 << 22540/**541* XML_SCHEMAS_TYPE_INTERNAL_INVALID:542*543* indicates that the type is invalid544*/545#define XML_SCHEMAS_TYPE_INTERNAL_INVALID 1 << 23546/**547* XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE:548*549* a whitespace-facet value of "preserve"550*/551#define XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE 1 << 24552/**553* XML_SCHEMAS_TYPE_WHITESPACE_REPLACE:554*555* a whitespace-facet value of "replace"556*/557#define XML_SCHEMAS_TYPE_WHITESPACE_REPLACE 1 << 25558/**559* XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE:560*561* a whitespace-facet value of "collapse"562*/563#define XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE 1 << 26564/**565* XML_SCHEMAS_TYPE_HAS_FACETS:566*567* has facets568*/569#define XML_SCHEMAS_TYPE_HAS_FACETS 1 << 27570/**571* XML_SCHEMAS_TYPE_NORMVALUENEEDED:572*573* indicates if the facets (pattern) need a normalized value574*/575#define XML_SCHEMAS_TYPE_NORMVALUENEEDED 1 << 28576577/**578* XML_SCHEMAS_TYPE_FIXUP_1:579*580* First stage of fixup was done.581*/582#define XML_SCHEMAS_TYPE_FIXUP_1 1 << 29583584/**585* XML_SCHEMAS_TYPE_REDEFINED:586*587* The type was redefined.588*/589#define XML_SCHEMAS_TYPE_REDEFINED 1 << 30590/**591* XML_SCHEMAS_TYPE_REDEFINING:592*593* The type redefines an other type.594*/595/* #define XML_SCHEMAS_TYPE_REDEFINING 1 << 31 */596597/**598* _xmlSchemaType:599*600* Schemas type definition.601*/602struct _xmlSchemaType {603xmlSchemaTypeType type; /* The kind of type */604struct _xmlSchemaType *next; /* the next type if in a sequence ... */605const xmlChar *name;606const xmlChar *id ; /* Deprecated; not used */607const xmlChar *ref; /* Deprecated; not used */608const xmlChar *refNs; /* Deprecated; not used */609xmlSchemaAnnotPtr annot;610xmlSchemaTypePtr subtypes;611xmlSchemaAttributePtr attributes; /* Deprecated; not used */612xmlNodePtr node;613int minOccurs; /* Deprecated; not used */614int maxOccurs; /* Deprecated; not used */615616int flags;617xmlSchemaContentType contentType;618const xmlChar *base; /* Base type's local name */619const xmlChar *baseNs; /* Base type's target namespace */620xmlSchemaTypePtr baseType; /* The base type component */621xmlSchemaFacetPtr facets; /* Local facets */622struct _xmlSchemaType *redef; /* Deprecated; not used */623int recurse; /* Obsolete */624xmlSchemaAttributeLinkPtr *attributeUses; /* Deprecated; not used */625xmlSchemaWildcardPtr attributeWildcard;626int builtInType; /* Type of built-in types. */627xmlSchemaTypeLinkPtr memberTypes; /* member-types if a union type. */628xmlSchemaFacetLinkPtr facetSet; /* All facets (incl. inherited) */629const xmlChar *refPrefix; /* Deprecated; not used */630xmlSchemaTypePtr contentTypeDef; /* Used for the simple content of complex types.631Could we use @subtypes for this? */632xmlRegexpPtr contModel; /* Holds the automaton of the content model */633const xmlChar *targetNamespace;634void *attrUses;635};636637/*638* xmlSchemaElement:639* An element definition.640*641* xmlSchemaType, xmlSchemaFacet and xmlSchemaElement start of642* structures must be kept similar643*/644/**645* XML_SCHEMAS_ELEM_NILLABLE:646*647* the element is nillable648*/649#define XML_SCHEMAS_ELEM_NILLABLE 1 << 0650/**651* XML_SCHEMAS_ELEM_GLOBAL:652*653* the element is global654*/655#define XML_SCHEMAS_ELEM_GLOBAL 1 << 1656/**657* XML_SCHEMAS_ELEM_DEFAULT:658*659* the element has a default value660*/661#define XML_SCHEMAS_ELEM_DEFAULT 1 << 2662/**663* XML_SCHEMAS_ELEM_FIXED:664*665* the element has a fixed value666*/667#define XML_SCHEMAS_ELEM_FIXED 1 << 3668/**669* XML_SCHEMAS_ELEM_ABSTRACT:670*671* the element is abstract672*/673#define XML_SCHEMAS_ELEM_ABSTRACT 1 << 4674/**675* XML_SCHEMAS_ELEM_TOPLEVEL:676*677* the element is top level678* obsolete: use XML_SCHEMAS_ELEM_GLOBAL instead679*/680#define XML_SCHEMAS_ELEM_TOPLEVEL 1 << 5681/**682* XML_SCHEMAS_ELEM_REF:683*684* the element is a reference to a type685*/686#define XML_SCHEMAS_ELEM_REF 1 << 6687/**688* XML_SCHEMAS_ELEM_NSDEFAULT:689*690* allow elements in no namespace691* Obsolete, not used anymore.692*/693#define XML_SCHEMAS_ELEM_NSDEFAULT 1 << 7694/**695* XML_SCHEMAS_ELEM_INTERNAL_RESOLVED:696*697* this is set when "type", "ref", "substitutionGroup"698* references have been resolved.699*/700#define XML_SCHEMAS_ELEM_INTERNAL_RESOLVED 1 << 8701/**702* XML_SCHEMAS_ELEM_CIRCULAR:703*704* a helper flag for the search of circular references.705*/706#define XML_SCHEMAS_ELEM_CIRCULAR 1 << 9707/**708* XML_SCHEMAS_ELEM_BLOCK_ABSENT:709*710* the "block" attribute is absent711*/712#define XML_SCHEMAS_ELEM_BLOCK_ABSENT 1 << 10713/**714* XML_SCHEMAS_ELEM_BLOCK_EXTENSION:715*716* disallowed substitutions are absent717*/718#define XML_SCHEMAS_ELEM_BLOCK_EXTENSION 1 << 11719/**720* XML_SCHEMAS_ELEM_BLOCK_RESTRICTION:721*722* disallowed substitutions: "restriction"723*/724#define XML_SCHEMAS_ELEM_BLOCK_RESTRICTION 1 << 12725/**726* XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION:727*728* disallowed substitutions: "substitution"729*/730#define XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION 1 << 13731/**732* XML_SCHEMAS_ELEM_FINAL_ABSENT:733*734* substitution group exclusions are absent735*/736#define XML_SCHEMAS_ELEM_FINAL_ABSENT 1 << 14737/**738* XML_SCHEMAS_ELEM_FINAL_EXTENSION:739*740* substitution group exclusions: "extension"741*/742#define XML_SCHEMAS_ELEM_FINAL_EXTENSION 1 << 15743/**744* XML_SCHEMAS_ELEM_FINAL_RESTRICTION:745*746* substitution group exclusions: "restriction"747*/748#define XML_SCHEMAS_ELEM_FINAL_RESTRICTION 1 << 16749/**750* XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD:751*752* the declaration is a substitution group head753*/754#define XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD 1 << 17755/**756* XML_SCHEMAS_ELEM_INTERNAL_CHECKED:757*758* this is set when the elem decl has been checked against759* all constraints760*/761#define XML_SCHEMAS_ELEM_INTERNAL_CHECKED 1 << 18762763typedef struct _xmlSchemaElement xmlSchemaElement;764typedef xmlSchemaElement *xmlSchemaElementPtr;765struct _xmlSchemaElement {766xmlSchemaTypeType type; /* The kind of type */767struct _xmlSchemaType *next; /* Not used? */768const xmlChar *name;769const xmlChar *id; /* Deprecated; not used */770const xmlChar *ref; /* Deprecated; not used */771const xmlChar *refNs; /* Deprecated; not used */772xmlSchemaAnnotPtr annot;773xmlSchemaTypePtr subtypes; /* the type definition */774xmlSchemaAttributePtr attributes;775xmlNodePtr node;776int minOccurs; /* Deprecated; not used */777int maxOccurs; /* Deprecated; not used */778779int flags;780const xmlChar *targetNamespace;781const xmlChar *namedType;782const xmlChar *namedTypeNs;783const xmlChar *substGroup;784const xmlChar *substGroupNs;785const xmlChar *scope;786const xmlChar *value; /* The original value of the value constraint. */787struct _xmlSchemaElement *refDecl; /* This will now be used for the788substitution group affiliation */789xmlRegexpPtr contModel; /* Obsolete for WXS, maybe used for RelaxNG */790xmlSchemaContentType contentType;791const xmlChar *refPrefix; /* Deprecated; not used */792xmlSchemaValPtr defVal; /* The compiled value constraint. */793void *idcs; /* The identity-constraint defs */794};795796/*797* XML_SCHEMAS_FACET_UNKNOWN:798*799* unknown facet handling800*/801#define XML_SCHEMAS_FACET_UNKNOWN 0802/*803* XML_SCHEMAS_FACET_PRESERVE:804*805* preserve the type of the facet806*/807#define XML_SCHEMAS_FACET_PRESERVE 1808/*809* XML_SCHEMAS_FACET_REPLACE:810*811* replace the type of the facet812*/813#define XML_SCHEMAS_FACET_REPLACE 2814/*815* XML_SCHEMAS_FACET_COLLAPSE:816*817* collapse the types of the facet818*/819#define XML_SCHEMAS_FACET_COLLAPSE 3820/**821* A facet definition.822*/823struct _xmlSchemaFacet {824xmlSchemaTypeType type; /* The kind of type */825struct _xmlSchemaFacet *next;/* the next type if in a sequence ... */826const xmlChar *value; /* The original value */827const xmlChar *id; /* Obsolete */828xmlSchemaAnnotPtr annot;829xmlNodePtr node;830int fixed; /* XML_SCHEMAS_FACET_PRESERVE, etc. */831int whitespace;832xmlSchemaValPtr val; /* The compiled value */833xmlRegexpPtr regexp; /* The regex for patterns */834};835836/**837* A notation definition.838*/839typedef struct _xmlSchemaNotation xmlSchemaNotation;840typedef xmlSchemaNotation *xmlSchemaNotationPtr;841struct _xmlSchemaNotation {842xmlSchemaTypeType type; /* The kind of type */843const xmlChar *name;844xmlSchemaAnnotPtr annot;845const xmlChar *identifier;846const xmlChar *targetNamespace;847};848849/*850* TODO: Actually all those flags used for the schema should sit851* on the schema parser context, since they are used only852* during parsing an XML schema document, and not available853* on the component level as per spec.854*/855/**856* XML_SCHEMAS_QUALIF_ELEM:857*858* Reflects elementFormDefault == qualified in859* an XML schema document.860*/861#define XML_SCHEMAS_QUALIF_ELEM 1 << 0862/**863* XML_SCHEMAS_QUALIF_ATTR:864*865* Reflects attributeFormDefault == qualified in866* an XML schema document.867*/868#define XML_SCHEMAS_QUALIF_ATTR 1 << 1869/**870* XML_SCHEMAS_FINAL_DEFAULT_EXTENSION:871*872* the schema has "extension" in the set of finalDefault.873*/874#define XML_SCHEMAS_FINAL_DEFAULT_EXTENSION 1 << 2875/**876* XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION:877*878* the schema has "restriction" in the set of finalDefault.879*/880#define XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION 1 << 3881/**882* XML_SCHEMAS_FINAL_DEFAULT_LIST:883*884* the schema has "list" in the set of finalDefault.885*/886#define XML_SCHEMAS_FINAL_DEFAULT_LIST 1 << 4887/**888* XML_SCHEMAS_FINAL_DEFAULT_UNION:889*890* the schema has "union" in the set of finalDefault.891*/892#define XML_SCHEMAS_FINAL_DEFAULT_UNION 1 << 5893/**894* XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION:895*896* the schema has "extension" in the set of blockDefault.897*/898#define XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION 1 << 6899/**900* XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION:901*902* the schema has "restriction" in the set of blockDefault.903*/904#define XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION 1 << 7905/**906* XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION:907*908* the schema has "substitution" in the set of blockDefault.909*/910#define XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION 1 << 8911/**912* XML_SCHEMAS_INCLUDING_CONVERT_NS:913*914* the schema is currently including an other schema with915* no target namespace.916*/917#define XML_SCHEMAS_INCLUDING_CONVERT_NS 1 << 9918/**919* _xmlSchema:920*921* A Schemas definition922*/923struct _xmlSchema {924const xmlChar *name; /* schema name */925const xmlChar *targetNamespace; /* the target namespace */926const xmlChar *version;927const xmlChar *id; /* Obsolete */928xmlDocPtr doc;929xmlSchemaAnnotPtr annot;930int flags;931932xmlHashTablePtr typeDecl;933xmlHashTablePtr attrDecl;934xmlHashTablePtr attrgrpDecl;935xmlHashTablePtr elemDecl;936xmlHashTablePtr notaDecl;937938xmlHashTablePtr schemasImports;939940void *_private; /* unused by the library for users or bindings */941xmlHashTablePtr groupDecl;942xmlDictPtr dict;943void *includes; /* the includes, this is opaque for now */944int preserve; /* whether to free the document */945int counter; /* used to give anonymous components unique names */946xmlHashTablePtr idcDef; /* All identity-constraint defs. */947void *volatiles; /* Obsolete */948};949950XMLPUBFUN void xmlSchemaFreeType (xmlSchemaTypePtr type);951XMLPUBFUN void xmlSchemaFreeWildcard(xmlSchemaWildcardPtr wildcard);952953#ifdef __cplusplus954}955#endif956957#endif /* LIBXML_SCHEMAS_ENABLED */958#endif /* __XML_SCHEMA_INTERNALS_H__ */959960961