Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

schemasInternals.h

Go to the documentation of this file.
00001 /*
00002  * schemasInternals.h : internal interfaces for the XML Schemas handling
00003  *                      and schema validity checking
00004  *
00005  * See Copyright for the status of this software.
00006  *
00007  * Daniel.Veillard@w3.org
00008  */
00009 
00010 
00011 #ifndef __XML_SCHEMA_INTERNALS_H__
00012 #define __XML_SCHEMA_INTERNALS_H__
00013 
00014 #include <libxml/xmlversion.h>
00015 
00016 #ifdef LIBXML_SCHEMAS_ENABLED
00017 
00018 #include <libxml/xmlregexp.h>
00019 #include <libxml/hash.h>
00020 
00021 #ifdef __cplusplus
00022 extern "C" {
00023 #endif
00024 
00025 
00026 /*
00027  * XML Schemas defines multiple type of types.
00028  */
00029 typedef enum {
00030     XML_SCHEMA_TYPE_BASIC = 1,
00031     XML_SCHEMA_TYPE_ANY,
00032     XML_SCHEMA_TYPE_FACET,
00033     XML_SCHEMA_TYPE_SIMPLE,
00034     XML_SCHEMA_TYPE_COMPLEX,
00035     XML_SCHEMA_TYPE_SEQUENCE,
00036     XML_SCHEMA_TYPE_CHOICE,
00037     XML_SCHEMA_TYPE_ALL,
00038     XML_SCHEMA_TYPE_SIMPLE_CONTENT,
00039     XML_SCHEMA_TYPE_COMPLEX_CONTENT,
00040     XML_SCHEMA_TYPE_UR,
00041     XML_SCHEMA_TYPE_RESTRICTION,
00042     XML_SCHEMA_TYPE_EXTENSION,
00043     XML_SCHEMA_TYPE_ELEMENT,
00044     XML_SCHEMA_TYPE_ATTRIBUTE,
00045     XML_SCHEMA_TYPE_ATTRIBUTEGROUP,
00046     XML_SCHEMA_TYPE_GROUP,
00047     XML_SCHEMA_TYPE_NOTATION,
00048     XML_SCHEMA_TYPE_LIST,
00049     XML_SCHEMA_TYPE_UNION,
00050     XML_SCHEMA_FACET_MININCLUSIVE = 1000,
00051     XML_SCHEMA_FACET_MINEXCLUSIVE,
00052     XML_SCHEMA_FACET_MAXINCLUSIVE,
00053     XML_SCHEMA_FACET_MAXEXCLUSIVE,
00054     XML_SCHEMA_FACET_TOTALDIGITS,
00055     XML_SCHEMA_FACET_FRACTIONDIGITS,
00056     XML_SCHEMA_FACET_PATTERN,
00057     XML_SCHEMA_FACET_ENUMERATION,
00058     XML_SCHEMA_FACET_WHITESPACE,
00059     XML_SCHEMA_FACET_LENGTH,
00060     XML_SCHEMA_FACET_MAXLENGTH,
00061     XML_SCHEMA_FACET_MINLENGTH
00062 } xmlSchemaTypeType;
00063 
00064 typedef enum {
00065     XML_SCHEMA_CONTENT_UNKNOWN = 0,
00066     XML_SCHEMA_CONTENT_EMPTY = 1,
00067     XML_SCHEMA_CONTENT_ELEMENTS,
00068     XML_SCHEMA_CONTENT_MIXED,
00069     XML_SCHEMA_CONTENT_SIMPLE,
00070     XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS,
00071     XML_SCHEMA_CONTENT_BASIC,
00072     XML_SCHEMA_CONTENT_ANY
00073 } xmlSchemaContentType;
00074 
00075 typedef struct _xmlSchemaVal xmlSchemaVal;
00076 typedef xmlSchemaVal *xmlSchemaValPtr;
00077 
00078 typedef struct _xmlSchemaType xmlSchemaType;
00079 typedef xmlSchemaType *xmlSchemaTypePtr;
00080 
00081 typedef struct _xmlSchemaFacet xmlSchemaFacet;
00082 typedef xmlSchemaFacet *xmlSchemaFacetPtr;
00083 
00087 typedef struct _xmlSchemaAnnot xmlSchemaAnnot;
00088 typedef xmlSchemaAnnot *xmlSchemaAnnotPtr;
00089 struct _xmlSchemaAnnot {
00090     struct _xmlSchemaAnnot *next;
00091     xmlNodePtr content;         /* the annotation */
00092 };
00093 
00098 #define XML_SCHEMAS_ANYATTR_SKIP        1
00099 #define XML_SCHEMAS_ANYATTR_LAX         2
00100 #define XML_SCHEMAS_ANYATTR_STRICT      3
00101 
00102 typedef struct _xmlSchemaAttribute xmlSchemaAttribute;
00103 typedef xmlSchemaAttribute *xmlSchemaAttributePtr;
00104 struct _xmlSchemaAttribute {
00105     xmlSchemaTypeType type;     /* The kind of type */
00106     struct _xmlSchemaAttribute *next;/* the next attribute if in a group ... */
00107     xmlChar *name;
00108     xmlChar *id;
00109     xmlChar *ref;
00110     xmlChar *refNs;
00111     xmlChar *typeName;
00112     xmlChar *typeNs;
00113     xmlSchemaAnnotPtr annot;
00114 
00115     xmlSchemaTypePtr base;
00116     int occurs;
00117     xmlChar *defValue;
00118     xmlSchemaTypePtr subtypes;
00119     xmlNodePtr node;
00120 };
00121 
00128 typedef struct _xmlSchemaAttributeGroup xmlSchemaAttributeGroup;
00129 typedef xmlSchemaAttributeGroup *xmlSchemaAttributeGroupPtr;
00130 struct _xmlSchemaAttributeGroup {
00131     xmlSchemaTypeType type;     /* The kind of type */
00132     struct _xmlSchemaAttribute *next;/* the next attribute if in a group ... */
00133     xmlChar *name;
00134     xmlChar *id;
00135     xmlChar *ref;
00136     xmlChar *refNs;
00137     xmlSchemaAnnotPtr annot;
00138 
00139     xmlSchemaAttributePtr attributes;
00140     xmlNodePtr node;
00141 };
00142 
00143 
00149 #define XML_SCHEMAS_TYPE_MIXED          1 << 0
00150 
00156 struct _xmlSchemaType {
00157     xmlSchemaTypeType type;     /* The kind of type */
00158     struct _xmlSchemaType *next;/* the next type if in a sequence ... */
00159     xmlChar *name;
00160     xmlChar *id;
00161     xmlChar *ref;
00162     xmlChar *refNs;
00163     xmlSchemaAnnotPtr annot;
00164     xmlSchemaTypePtr subtypes;
00165     xmlSchemaAttributePtr attributes;
00166     xmlNodePtr node;
00167     int minOccurs;
00168     int maxOccurs;
00169 
00170     int flags;
00171     xmlSchemaContentType contentType;
00172     xmlChar *base;
00173     xmlChar *baseNs;
00174     xmlSchemaTypePtr baseType;
00175     xmlSchemaFacetPtr facets;
00176 };
00177 
00190 #define XML_SCHEMAS_ELEM_NILLABLE       1 << 0
00191 
00196 #define XML_SCHEMAS_ELEM_GLOBAL         1 << 1
00197 
00202 #define XML_SCHEMAS_ELEM_DEFAULT        1 << 2
00203 
00208 #define XML_SCHEMAS_ELEM_FIXED          1 << 3
00209 
00214 #define XML_SCHEMAS_ELEM_ABSTRACT       1 << 4
00215 
00220 #define XML_SCHEMAS_ELEM_TOPLEVEL       1 << 5
00221 
00226 #define XML_SCHEMAS_ELEM_REF            1 << 6
00227 
00228 typedef struct _xmlSchemaElement xmlSchemaElement;
00229 typedef xmlSchemaElement *xmlSchemaElementPtr;
00230 struct _xmlSchemaElement {
00231     xmlSchemaTypeType type;     /* The kind of type */
00232     struct _xmlSchemaType *next;/* the next type if in a sequence ... */
00233     xmlChar *name;
00234     xmlChar *id;
00235     xmlChar *ref;
00236     xmlChar *refNs;
00237     xmlSchemaAnnotPtr annot;
00238     xmlSchemaTypePtr subtypes;
00239     xmlSchemaAttributePtr attributes;
00240     xmlNodePtr node;
00241     int minOccurs;
00242     int maxOccurs;
00243 
00244     int flags;
00245     xmlChar *targetNamespace;
00246     xmlChar *namedType;
00247     xmlChar *namedTypeNs;
00248     xmlChar *substGroup;
00249     xmlChar *substGroupNs;
00250     xmlChar *scope;
00251     xmlChar *value;
00252     struct _xmlSchemaElement *refDecl;
00253     xmlRegexpPtr contModel;
00254     xmlSchemaContentType contentType;
00255 };
00256 
00257 /*
00258  * XML_SCHEMAS_FACET_UNKNOWN:
00259  *
00260  * unknown facet handling
00261  */
00262 #define XML_SCHEMAS_FACET_UNKNOWN       0
00263 /*
00264  * XML_SCHEMAS_FACET_PRESERVE:
00265  *
00266  * preserve the type of the facet
00267  */
00268 #define XML_SCHEMAS_FACET_PRESERVE      1
00269 /*
00270  * XML_SCHEMAS_FACET_REPLACE:
00271  *
00272  * replace the type of the facet
00273  */
00274 #define XML_SCHEMAS_FACET_REPLACE       2
00275 /*
00276  * XML_SCHEMAS_FACET_COLLAPSE:
00277  *
00278  * collapse the types of the facet
00279  */
00280 #define XML_SCHEMAS_FACET_COLLAPSE      3
00281 
00285 struct _xmlSchemaFacet {
00286     xmlSchemaTypeType type;     /* The kind of type */
00287     struct _xmlSchemaFacet *next;/* the next type if in a sequence ... */
00288     xmlChar *value;
00289     xmlChar *id;
00290     xmlSchemaAnnotPtr annot;
00291     xmlNodePtr node;
00292     int fixed;
00293     int whitespace;
00294     xmlSchemaValPtr val;
00295     xmlRegexpPtr    regexp;
00296 };
00297 
00301 typedef struct _xmlSchemaNotation xmlSchemaNotation;
00302 typedef xmlSchemaNotation *xmlSchemaNotationPtr;
00303 struct _xmlSchemaNotation {
00304     xmlSchemaTypeType type;     /* The kind of type */
00305     xmlChar *name;
00306     xmlSchemaAnnotPtr annot;
00307     xmlChar *identifier;
00308 };
00309 
00315 #define XML_SCHEMAS_QUALIF_ELEM         1 << 0
00316 
00321 #define XML_SCHEMAS_QUALIF_ATTR         1 << 1
00322 
00327 struct _xmlSchema {
00328     xmlChar *name;        /* schema name */
00329     xmlChar *targetNamespace;     /* the target namespace */
00330     xmlChar *version;
00331     xmlChar *id;
00332     xmlDocPtr doc;
00333     xmlSchemaAnnotPtr annot;
00334     int flags;
00335 
00336     xmlHashTablePtr typeDecl;
00337     xmlHashTablePtr attrDecl;
00338     xmlHashTablePtr attrgrpDecl;
00339     xmlHashTablePtr elemDecl;
00340     xmlHashTablePtr notaDecl;
00341 
00342     xmlHashTablePtr schemasImports;
00343 
00344     void *_private;     /* unused by the library for users or bindings */
00345     xmlHashTablePtr groupDecl;
00346 };
00347 
00348 XMLPUBFUN void XMLCALL  xmlSchemaFreeType       (xmlSchemaTypePtr type);
00349 
00350 #ifdef __cplusplus
00351 }
00352 #endif
00353 
00354 #endif /* LIBXML_SCHEMAS_ENABLED */
00355 #endif /* __XML_SCHEMA_INTERNALS_H__ */
00356 
00357 
00358 

Generated on Wed Mar 16 00:10:27 2005 for Dibbler - a portable DHCPv6 by  doxygen 1.3.9.1