# ## Module xmlschemastypes from libxml2

API Menu
Main Menu Developer Menu Code Examples API Menu Parser API Tree API Reader API XML Guidelines ChangeLog
API Indexes
Alphabetic Constructors Functions/Types Modules Symbols
Related links
Mail archive XSLT libxslt DOM gdome2 XML-DSig xmlsec FTP Windows binaries Solaris binaries MacOsX binaries Pascal bindings Bug Tracker
module providing the XML Schema Datatypes implementation both definition and validity checking ## Table of Contents
    int	xmlSchemaCheckFacet		(xmlSchemaFacetPtr facet,
    					 xmlSchemaTypePtr typeDecl,
    					 xmlSchemaParserCtxtPtr ctxt,
    					 const xmlChar * name)
    void	xmlSchemaCleanupTypes		(void)
    xmlChar *	xmlSchemaCollapseString	(const xmlChar * value)
    int	xmlSchemaCompareValues		(xmlSchemaValPtr x,
    					 xmlSchemaValPtr y)
    void	xmlSchemaFreeFacet		(xmlSchemaFacetPtr facet)
    void	xmlSchemaFreeValue		(xmlSchemaValPtr value)
    xmlSchemaTypePtr	xmlSchemaGetBuiltInListSimpleTypeItemType	(xmlSchemaTypePtr type)
    xmlSchemaTypePtr	xmlSchemaGetBuiltInType	(xmlSchemaValType type)
    unsigned long	xmlSchemaGetFacetValueAsULong	(xmlSchemaFacetPtr facet)
    xmlSchemaTypePtr	xmlSchemaGetPredefinedType	(const xmlChar * name,
    							 const xmlChar * ns)
    void	xmlSchemaInitTypes		(void)
    int	xmlSchemaIsBuiltInTypeFacet	(xmlSchemaTypePtr type,
    					 int facetType)
    xmlSchemaFacetPtr	xmlSchemaNewFacet	(void)
    int	xmlSchemaValPredefTypeNode	(xmlSchemaTypePtr type,
    					 const xmlChar * value,
    					 xmlSchemaValPtr * val,
    					 xmlNodePtr node)
    int	xmlSchemaValPredefTypeNodeNoNorm	(xmlSchemaTypePtr type,
    						 const xmlChar * value,
    						 xmlSchemaValPtr * val,
    						 xmlNodePtr node)
    int	xmlSchemaValidateFacet		(xmlSchemaTypePtr base,
    					 xmlSchemaFacetPtr facet,
    					 const xmlChar * value,
    					 xmlSchemaValPtr val)
    int	xmlSchemaValidateLengthFacet	(xmlSchemaTypePtr type,
    					 xmlSchemaFacetPtr facet,
    					 const xmlChar * value,
    					 xmlSchemaValPtr val,
    					 unsigned long * length)
    int	xmlSchemaValidateListSimpleTypeFacet	(xmlSchemaFacetPtr facet,
    						 const xmlChar * value,
    						 unsigned long actualLen,
    						 unsigned long * expectedLen)
    int	xmlSchemaValidatePredefinedType	(xmlSchemaTypePtr type,
    					 const xmlChar * value,
    					 xmlSchemaValPtr * val)
## Description ### Function: xmlSchemaCheckFacet
    int	xmlSchemaCheckFacet		(xmlSchemaFacetPtr facet,
    					 xmlSchemaTypePtr typeDecl,
    					 xmlSchemaParserCtxtPtr ctxt,
    					 const xmlChar * name)
Checks the default values types, especially for facets
`facet`: | the facet
`typeDecl`: | the schema type definition
`ctxt`: | the schema parser context or NULL
`name`: | name of the type
`Returns`: | 0 if okay or -1 in cae of error
### Function: xmlSchemaCleanupTypes
    void	xmlSchemaCleanupTypes		(void)
Cleanup the default XML Schemas type library ### Function: xmlSchemaCollapseString
    xmlChar *	xmlSchemaCollapseString	(const xmlChar * value)
Removes and normalize white spaces in the string
`value`: | a value
`Returns`: | the new string or NULL if no change was required.
### Function: xmlSchemaCompareValues
    int	xmlSchemaCompareValues		(xmlSchemaValPtr x,
    					 xmlSchemaValPtr y)
Compare 2 values
`x`: | a first value
`y`: | a second value
`Returns`: | -1 if x < y, 0 if x == y, 1 if x > y, 2 if x <> y, and -2 in case of error
### Function: xmlSchemaFreeFacet
    void	xmlSchemaFreeFacet		(xmlSchemaFacetPtr facet)
Deallocate a Schema Facet structure.
`facet`: | a schema facet structure
### Function: xmlSchemaFreeValue
    void	xmlSchemaFreeValue		(xmlSchemaValPtr value)
Cleanup the default XML Schemas type library
`value`: | the value to free
### Function: xmlSchemaGetBuiltInListSimpleTypeItemType
    xmlSchemaTypePtr	xmlSchemaGetBuiltInListSimpleTypeItemType	(xmlSchemaTypePtr type)
Lookup function
`type`: | the built-in simple type.
`Returns`: | the item type of @type as defined by the built-in datatype hierarchy of XML Schema Part 2: Datatypes, or NULL in case of an error.
### Function: xmlSchemaGetBuiltInType
    xmlSchemaTypePtr	xmlSchemaGetBuiltInType	(xmlSchemaValType type)
Gives you the type struct for a built-in type by its type id.
`type`: | the type of the built in type
`Returns`: | the type if found, NULL otherwise.
### Function: xmlSchemaGetFacetValueAsULong
    unsigned long	xmlSchemaGetFacetValueAsULong	(xmlSchemaFacetPtr facet)
Extract the value of a facet
`facet`: | an schemas type facet
`Returns`: | the value as a long
### Function: xmlSchemaGetPredefinedType
    xmlSchemaTypePtr	xmlSchemaGetPredefinedType	(const xmlChar * name,
    							 const xmlChar * ns)
Lookup a type in the default XML Schemas type library
`name`: | the type name
`ns`: | the URI of the namespace usually "http://www.w3.org/2001/XMLSchema"
`Returns`: | the type if found, NULL otherwise
### Function: xmlSchemaInitTypes
    void	xmlSchemaInitTypes		(void)
Initialize the default XML Schemas type library ### Function: xmlSchemaIsBuiltInTypeFacet
    int	xmlSchemaIsBuiltInTypeFacet	(xmlSchemaTypePtr type,
    					 int facetType)
Evaluates if a specific facet can be used in conjunction with a type.
`type`: | the built-in type
`facetType`: | the facet type
`Returns`: | 1 if the facet can be used with the given built-in type, 0 otherwise and -1 in case the type is not a built-in type.
### Function: xmlSchemaNewFacet
    xmlSchemaFacetPtr	xmlSchemaNewFacet	(void)
Allocate a new Facet structure.
`Returns`: | the newly allocated structure or NULL in case or error
### Function: xmlSchemaValPredefTypeNode
    int	xmlSchemaValPredefTypeNode	(xmlSchemaTypePtr type,
    					 const xmlChar * value,
    					 xmlSchemaValPtr * val,
    					 xmlNodePtr node)
Check that a value conforms to the lexical space of the predefined type. if true a value is computed and returned in @val.
`type`: | the predefined type
`value`: | the value to check
`val`: | the return computed value
`node`: | the node containing the value
`Returns`: | 0 if this validates, a positive error code number otherwise and -1 in case of internal or API error.
### Function: xmlSchemaValPredefTypeNodeNoNorm
    int	xmlSchemaValPredefTypeNodeNoNorm	(xmlSchemaTypePtr type,
    						 const xmlChar * value,
    						 xmlSchemaValPtr * val,
    						 xmlNodePtr node)
Check that a value conforms to the lexical space of the predefined type. if true a value is computed and returned in @val. This one does apply any normalization to the value.
`type`: | the predefined type
`value`: | the value to check
`val`: | the return computed value
`node`: | the node containing the value
`Returns`: | 0 if this validates, a positive error code number otherwise and -1 in case of internal or API error.
### Function: xmlSchemaValidateFacet
    int	xmlSchemaValidateFacet		(xmlSchemaTypePtr base,
    					 xmlSchemaFacetPtr facet,
    					 const xmlChar * value,
    					 xmlSchemaValPtr val)
Check a value against a facet condition
`base`: | the base type
`facet`: | the facet to check
`value`: | the lexical repr of the value to validate
`val`: | the precomputed value
`Returns`: | 0 if the element is schemas valid, a positive error code number otherwise and -1 in case of internal or API error.
### Function: xmlSchemaValidateLengthFacet
    int	xmlSchemaValidateLengthFacet	(xmlSchemaTypePtr type,
    					 xmlSchemaFacetPtr facet,
    					 const xmlChar * value,
    					 xmlSchemaValPtr val,
    					 unsigned long * length)
Checka a value against a "length", "minLength" and "maxLength" facet; sets @length to the computed length of @value.
`type`: | the built-in type
`facet`: | the facet to check
`value`: | the lexical repr. of the value to be validated
`val`: | the precomputed value
`length`: | the actual length of the value
`Returns`: | 0 if the value is valid, a positive error code otherwise and -1 in case of an internal or API error.
### Function: xmlSchemaValidateListSimpleTypeFacet
    int	xmlSchemaValidateListSimpleTypeFacet	(xmlSchemaFacetPtr facet,
    						 const xmlChar * value,
    						 unsigned long actualLen,
    						 unsigned long * expectedLen)
Checks the value of a list simple type against a facet.
`facet`: | the facet to check
`value`: | the lexical repr of the value to validate
`actualLen`: | the number of list items
`expectedLen`: | the resulting expected number of list items
`Returns`: | 0 if the value is valid, a positive error code number otherwise and -1 in case of an internal error.
### Function: xmlSchemaValidatePredefinedType
    int	xmlSchemaValidatePredefinedType	(xmlSchemaTypePtr type,
    					 const xmlChar * value,
    					 xmlSchemaValPtr * val)
Check that a value conforms to the lexical space of the predefined type. if true a value is computed and returned in @val.
`type`: | the predefined type
`value`: | the value to check
`val`: | the return computed value
`Returns`: | 0 if this validates, a positive error code number otherwise and -1 in case of internal or API error.
Daniel Veillard