/*
* Summary: internal interfaces for XML Schemas
* Description: internal interfaces for the XML Schemas handling
* and schema validity checking
* The Schemas development is a Work In Progress.
* Some of those interfaces are not garanteed to be API or ABI stable !
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_SCHEMA_INTERNALS_H__
#define __XML_SCHEMA_INTERNALS_H__
#include <libxml/xmlversion.h>
#ifdef LIBXML_SCHEMAS_ENABLED
#include <libxml/xmlregexp.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
XML_SCHEMAS_UNKNOWN = 0,
/*
* XML Schemas defines multiple type of types.
*/
typedef enum {
typedef enum {
/**
* Annotation
*/
struct _xmlSchemaAnnot {
};
/**
* XML_SCHEMAS_ANYATTR_SKIP:
*
* Skip unknown attribute from validation
* Obsolete, not used anymore.
*/
/**
* XML_SCHEMAS_ANYATTR_LAX:
*
* Ignore validation non definition on attributes
* Obsolete, not used anymore.
*/
/**
* XML_SCHEMAS_ANYATTR_STRICT:
*
* Apply strict validation rules on attributes
* Obsolete, not used anymore.
*/
/**
* XML_SCHEMAS_ANY_SKIP:
*
* Skip unknown attribute from validation
*/
/**
* XML_SCHEMAS_ANY_LAX:
*
* Used by wildcards.
* Validate if type found, don't worry if not found
*/
/**
* XML_SCHEMAS_ANY_STRICT:
*
* Used by wildcards.
* Apply strict validation rules
*/
/**
* XML_SCHEMAS_ATTR_USE_PROHIBITED:
*
* Used by wildcards.
* The attribute is prohibited.
*/
#define XML_SCHEMAS_ATTR_USE_PROHIBITED 0
/**
* XML_SCHEMAS_ATTR_USE_REQUIRED:
*
* The attribute is required.
*/
/**
* XML_SCHEMAS_ATTR_USE_OPTIONAL:
*
* The attribute is optional.
*/
/**
* XML_SCHEMAS_ATTR_GLOBAL:
*
* allow elements in no namespace
*/
/**
* XML_SCHEMAS_ATTR_NSDEFAULT:
*
* allow elements in no namespace
*/
/**
* XML_SCHEMAS_ATTR_INTERNAL_RESOLVED:
*
* this is set when the "type" and "ref" references
* have been resolved.
*/
/**
* XML_SCHEMAS_ATTR_FIXED:
*
* the attribute has a fixed value
*/
/**
* xmlSchemaAttribute:
* An attribute definition.
*/
struct _xmlSchemaAttribute {
int flags;
};
/**
* xmlSchemaAttributeLink:
* Used to build a list of attribute uses on complexType definitions.
* WARNING: Deprecated; not used.
*/
struct _xmlSchemaAttributeLink {
};
/**
* XML_SCHEMAS_WILDCARD_COMPLETE:
*
* If the wildcard is complete.
*/
/**
* xmlSchemaCharValueLink:
* Used to build a list of namespaces on wildcards.
*/
struct _xmlSchemaWildcardNs {
};
/**
* xmlSchemaWildcard.
* A wildcard.
*/
struct _xmlSchemaWildcard {
int processContents;
int flags;
};
/**
* XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED:
*
* The attribute wildcard has been already builded.
*/
/**
* XML_SCHEMAS_ATTRGROUP_GLOBAL:
*
* The attribute wildcard has been already builded.
*/
/**
* XML_SCHEMAS_ATTRGROUP_MARKED:
*
* Marks the attr group as marked; used for circular checks.
*/
/**
* XML_SCHEMAS_ATTRGROUP_REDEFINED:
*
* The attr group was redefined.
*/
/**
* XML_SCHEMAS_ATTRGROUP_HAS_REFS:
*
* Whether this attr. group contains attr. group references.
*/
/**
* An attribute group definition.
*
* xmlSchemaAttribute and xmlSchemaAttributeGroup start of structures
* must be kept similar
*/
struct _xmlSchemaAttributeGroup {
int flags;
void *attrUses;
};
/**
* xmlSchemaTypeLink:
* Used to build a list of types (e.g. member types of
* simpleType with variety "union").
*/
struct _xmlSchemaTypeLink {
};
/**
* xmlSchemaFacetLink:
* Used to build a list of facets.
*/
struct _xmlSchemaFacetLink {
};
/**
* XML_SCHEMAS_TYPE_MIXED:
*
* the element content type is mixed
*/
/**
* XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION:
*
* the simple or complex type has a derivation method of "extension".
*/
/**
* XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION:
*
* the simple or complex type has a derivation method of "restriction".
*/
/**
* XML_SCHEMAS_TYPE_GLOBAL:
*
* the type is global
*/
/**
* XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD:
*
* the complexType owns an attribute wildcard, i.e.
* it can be freed by the complexType
*/
/**
* XML_SCHEMAS_TYPE_VARIETY_ABSENT:
*
* the simpleType has a variety of "absent".
* TODO: Actually not necessary :-/, since if
* none of the variety flags occur then it's
* automatically absent.
*/
/**
* XML_SCHEMAS_TYPE_VARIETY_LIST:
*
* the simpleType has a variety of "list".
*/
/**
* XML_SCHEMAS_TYPE_VARIETY_UNION:
*
* the simpleType has a variety of "union".
*/
/**
* XML_SCHEMAS_TYPE_VARIETY_ATOMIC:
*
* the simpleType has a variety of "union".
*/
/**
* XML_SCHEMAS_TYPE_FINAL_EXTENSION:
*
* the complexType has a final of "extension".
*/
/**
* XML_SCHEMAS_TYPE_FINAL_RESTRICTION:
*
* the simpleType/complexType has a final of "restriction".
*/
/**
* XML_SCHEMAS_TYPE_FINAL_LIST:
*
* the simpleType has a final of "list".
*/
/**
* XML_SCHEMAS_TYPE_FINAL_UNION:
*
* the simpleType has a final of "union".
*/
/**
* XML_SCHEMAS_TYPE_FINAL_DEFAULT:
*
* the simpleType has a final of "default".
*/
/**
* XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE:
*
* Marks the item as a builtin primitive.
*/
/**
* XML_SCHEMAS_TYPE_MARKED:
*
* Marks the item as marked; used for circular checks.
*/
/**
* XML_SCHEMAS_TYPE_BLOCK_DEFAULT:
*
* the complexType did not specify 'block' so use the default of the
* <schema> item.
*/
/**
* XML_SCHEMAS_TYPE_BLOCK_EXTENSION:
*
* the complexType has a 'block' of "extension".
*/
/**
* XML_SCHEMAS_TYPE_BLOCK_RESTRICTION:
*
* the complexType has a 'block' of "restriction".
*/
/**
* XML_SCHEMAS_TYPE_ABSTRACT:
*
* the simple/complexType is abstract.
*/
/**
* XML_SCHEMAS_TYPE_FACETSNEEDVALUE:
*
* indicates if the facets need a computed value
*/
/**
* XML_SCHEMAS_TYPE_INTERNAL_RESOLVED:
*
* indicates that the type was typefixed
*/
/**
* XML_SCHEMAS_TYPE_INTERNAL_INVALID:
*
* indicates that the type is invalid
*/
/**
* XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE:
*
* a whitespace-facet value of "preserve"
*/
/**
* XML_SCHEMAS_TYPE_WHITESPACE_REPLACE:
*
* a whitespace-facet value of "replace"
*/
/**
* XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE:
*
* a whitespace-facet value of "collapse"
*/
/**
* XML_SCHEMAS_TYPE_HAS_FACETS:
*
* has facets
*/
/**
* XML_SCHEMAS_TYPE_NORMVALUENEEDED:
*
* indicates if the facets (pattern) need a normalized value
*/
/**
* XML_SCHEMAS_TYPE_FIXUP_1:
*
* First stage of fixup was done.
*/
/**
* XML_SCHEMAS_TYPE_REDEFINED:
*
* The type was redefined.
*/
/**
* XML_SCHEMAS_TYPE_REDEFINING:
*
* The type redefines an other type.
*/
/* #define XML_SCHEMAS_TYPE_REDEFINING 1 << 31 */
/**
* _xmlSchemaType:
*
* Schemas type definition.
*/
struct _xmlSchemaType {
int flags;
Could we use @subtypes for this? */
void *attrUses;
};
/*
* xmlSchemaElement:
* An element definition.
*
* xmlSchemaType, xmlSchemaFacet and xmlSchemaElement start of
* structures must be kept similar
*/
/**
* XML_SCHEMAS_ELEM_NILLABLE:
*
* the element is nillable
*/
/**
* XML_SCHEMAS_ELEM_GLOBAL:
*
* the element is global
*/
/**
* XML_SCHEMAS_ELEM_DEFAULT:
*
* the element has a default value
*/
/**
* XML_SCHEMAS_ELEM_FIXED:
*
* the element has a fixed value
*/
/**
* XML_SCHEMAS_ELEM_ABSTRACT:
*
* the element is abstract
*/
/**
* XML_SCHEMAS_ELEM_TOPLEVEL:
*
* the element is top level
* obsolete: use XML_SCHEMAS_ELEM_GLOBAL instead
*/
/**
* XML_SCHEMAS_ELEM_REF:
*
* the element is a reference to a type
*/
/**
* XML_SCHEMAS_ELEM_NSDEFAULT:
*
* allow elements in no namespace
* Obsolete, not used anymore.
*/
/**
* XML_SCHEMAS_ELEM_INTERNAL_RESOLVED:
*
* this is set when "type", "ref", "substitutionGroup"
* references have been resolved.
*/
/**
* XML_SCHEMAS_ELEM_CIRCULAR:
*
* a helper flag for the search of circular references.
*/
/**
* XML_SCHEMAS_ELEM_BLOCK_ABSENT:
*
* the "block" attribute is absent
*/
/**
* XML_SCHEMAS_ELEM_BLOCK_EXTENSION:
*
* disallowed substitutions are absent
*/
/**
* XML_SCHEMAS_ELEM_BLOCK_RESTRICTION:
*
* disallowed substitutions: "restriction"
*/
/**
* XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION:
*
* disallowed substitutions: "substituion"
*/
/**
* XML_SCHEMAS_ELEM_FINAL_ABSENT:
*
* substitution group exclusions are absent
*/
/**
* XML_SCHEMAS_ELEM_FINAL_EXTENSION:
*
* substitution group exclusions: "extension"
*/
/**
* XML_SCHEMAS_ELEM_FINAL_RESTRICTION:
*
* substitution group exclusions: "restriction"
*/
/**
* XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD:
*
* the declaration is a substitution group head
*/
/**
* XML_SCHEMAS_ELEM_INTERNAL_CHECKED:
*
* this is set when the elem decl has been checked against
* all constraints
*/
struct _xmlSchemaElement {
int flags;
substitution group affiliation */
};
/*
* XML_SCHEMAS_FACET_UNKNOWN:
*
* unknown facet handling
*/
#define XML_SCHEMAS_FACET_UNKNOWN 0
/*
* XML_SCHEMAS_FACET_PRESERVE:
*
* preserve the type of the facet
*/
/*
* XML_SCHEMAS_FACET_REPLACE:
*
* replace the type of the facet
*/
/*
* XML_SCHEMAS_FACET_COLLAPSE:
*
* collapse the types of the facet
*/
/**
* A facet definition.
*/
struct _xmlSchemaFacet {
int whitespace;
};
/**
* A notation definition.
*/
struct _xmlSchemaNotation {
};
/*
* TODO: Actually all those flags used for the schema should sit
* on the schema parser context, since they are used only
* during parsing an XML schema document, and not available
* on the component level as per spec.
*/
/**
* XML_SCHEMAS_QUALIF_ELEM:
*
* Reflects elementFormDefault == qualified in
* an XML schema document.
*/
/**
* XML_SCHEMAS_QUALIF_ATTR:
*
* Reflects attributeFormDefault == qualified in
* an XML schema document.
*/
/**
* XML_SCHEMAS_FINAL_DEFAULT_EXTENSION:
*
* the schema has "extension" in the set of finalDefault.
*/
/**
* XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION:
*
* the schema has "restriction" in the set of finalDefault.
*/
/**
* XML_SCHEMAS_FINAL_DEFAULT_LIST:
*
* the cshema has "list" in the set of finalDefault.
*/
/**
* XML_SCHEMAS_FINAL_DEFAULT_UNION:
*
* the schema has "union" in the set of finalDefault.
*/
/**
* XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION:
*
* the schema has "extension" in the set of blockDefault.
*/
/**
* XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION:
*
* the schema has "restriction" in the set of blockDefault.
*/
/**
* XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION:
*
* the schema has "substitution" in the set of blockDefault.
*/
/**
* XML_SCHEMAS_INCLUDING_CONVERT_NS:
*
* the schema is currently including an other schema with
* no target namespace.
*/
/**
* _xmlSchema:
*
* A Schemas definition
*/
struct _xmlSchema {
int flags;
};
#ifdef __cplusplus
}
#endif
#endif /* LIBXML_SCHEMAS_ENABLED */
#endif /* __XML_SCHEMA_INTERNALS_H__ */