Blame doc/html/libxml-xmlschemastypes.html

Packit Service a31ea6
Packit Service a31ea6
Packit Service a31ea6
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><link rel="SHORTCUT ICON" href="/favicon.ico" /><style type="text/css">
Packit Service a31ea6
TD {font-family: Verdana,Arial,Helvetica}
Packit Service a31ea6
BODY {font-family: Verdana,Arial,Helvetica; margin-top: 2em; margin-left: 0em; margin-right: 0em}
Packit Service a31ea6
H1 {font-family: Verdana,Arial,Helvetica}
Packit Service a31ea6
H2 {font-family: Verdana,Arial,Helvetica}
Packit Service a31ea6
H3 {font-family: Verdana,Arial,Helvetica}
Packit Service a31ea6
A:link, A:visited, A:active { text-decoration: underline }
Packit Service a31ea6
</style><style type="text/css">
Packit Service a31ea6
      div.deprecated pre.programlisting {border-style: double;border-color:red}
Packit Service a31ea6
      pre.programlisting {border-style: double;background: #EECFA1}
Packit Service a31ea6
    </style><title>Module xmlschemastypes from libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000">
Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
Made with Libxml2 Logo

Module xmlschemastypes from libxml2

<center>API Menu</center>
<form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form>
<center>API Indexes</center>
<center>Related links</center>

module providing the XML Schema Datatypes implementation both definition and validity checking

Table of Contents

Enum xmlSchemaWhitespaceValueType
Packit Service a31ea6
int	xmlSchemaCheckFacet		(xmlSchemaFacetPtr facet, 
xmlSchemaTypePtr typeDecl,
xmlSchemaParserCtxtPtr pctxt,
const xmlChar * name)
Packit Service a31ea6
void	xmlSchemaCleanupTypes		(void)
Packit Service a31ea6
xmlChar *	xmlSchemaCollapseString	(const xmlChar * value)
Packit Service a31ea6
int	xmlSchemaCompareValues		(xmlSchemaValPtr x, 
xmlSchemaValPtr y)
Packit Service a31ea6
int	xmlSchemaCompareValuesWhtsp	(xmlSchemaValPtr x, 
xmlSchemaWhitespaceValueType xws,
xmlSchemaValPtr y,
xmlSchemaWhitespaceValueType yws)
Packit Service a31ea6
xmlSchemaValPtr	xmlSchemaCopyValue	(xmlSchemaValPtr val)
Packit Service a31ea6
void	xmlSchemaFreeFacet		(xmlSchemaFacetPtr facet)
Packit Service a31ea6
void	xmlSchemaFreeValue		(xmlSchemaValPtr value)
Packit Service a31ea6
xmlSchemaTypePtr	xmlSchemaGetBuiltInListSimpleTypeItemType	(xmlSchemaTypePtr type)
Packit Service a31ea6
xmlSchemaTypePtr	xmlSchemaGetBuiltInType	(xmlSchemaValType type)
Packit Service a31ea6
int	xmlSchemaGetCanonValue		(xmlSchemaValPtr val, 
const xmlChar ** retValue)
Packit Service a31ea6
int	xmlSchemaGetCanonValueWhtsp	(xmlSchemaValPtr val, 
const xmlChar ** retValue,
xmlSchemaWhitespaceValueType ws)
Packit Service a31ea6
unsigned long	xmlSchemaGetFacetValueAsULong	(xmlSchemaFacetPtr facet)
Packit Service a31ea6
xmlSchemaTypePtr	xmlSchemaGetPredefinedType	(const xmlChar * name, 
const xmlChar * ns)
Packit Service a31ea6
xmlSchemaValType	xmlSchemaGetValType	(xmlSchemaValPtr val)
Packit Service a31ea6
void	xmlSchemaInitTypes		(void)
Packit Service a31ea6
int	xmlSchemaIsBuiltInTypeFacet	(xmlSchemaTypePtr type, 
int facetType)
Packit Service a31ea6
xmlSchemaFacetPtr	xmlSchemaNewFacet	(void)
Packit Service a31ea6
xmlSchemaValPtr	xmlSchemaNewNOTATIONValue	(const xmlChar * name, 
const xmlChar * ns)
Packit Service a31ea6
xmlSchemaValPtr	xmlSchemaNewQNameValue	(const xmlChar * namespaceName, 
const xmlChar * localName)
Packit Service a31ea6
xmlSchemaValPtr	xmlSchemaNewStringValue	(xmlSchemaValType type, 
const xmlChar * value)
Packit Service a31ea6
int	xmlSchemaValPredefTypeNode	(xmlSchemaTypePtr type, 
const xmlChar * value,
xmlSchemaValPtr * val,
xmlNodePtr node)
Packit Service a31ea6
int	xmlSchemaValPredefTypeNodeNoNorm	(xmlSchemaTypePtr type, 
const xmlChar * value,
xmlSchemaValPtr * val,
xmlNodePtr node)
Packit Service a31ea6
int	xmlSchemaValidateFacet		(xmlSchemaTypePtr base, 
xmlSchemaFacetPtr facet,
const xmlChar * value,
xmlSchemaValPtr val)
Packit Service a31ea6
int	xmlSchemaValidateFacetWhtsp	(xmlSchemaFacetPtr facet, 
xmlSchemaWhitespaceValueType fws,
xmlSchemaValType valType,
const xmlChar * value,
xmlSchemaValPtr val,
xmlSchemaWhitespaceValueType ws)
Packit Service a31ea6
int	xmlSchemaValidateLengthFacet	(xmlSchemaTypePtr type, 
xmlSchemaFacetPtr facet,
const xmlChar * value,
xmlSchemaValPtr val,
unsigned long * length)
Packit Service a31ea6
int	xmlSchemaValidateLengthFacetWhtsp	(xmlSchemaFacetPtr facet, 
xmlSchemaValType valType,
const xmlChar * value,
xmlSchemaValPtr val,
unsigned long * length,
xmlSchemaWhitespaceValueType ws)
Packit Service a31ea6
int	xmlSchemaValidateListSimpleTypeFacet	(xmlSchemaFacetPtr facet, 
const xmlChar * value,
unsigned long actualLen,
unsigned long * expectedLen)
Packit Service a31ea6
int	xmlSchemaValidatePredefinedType	(xmlSchemaTypePtr type, 
const xmlChar * value,
xmlSchemaValPtr * val)
Packit Service a31ea6
int	xmlSchemaValueAppend		(xmlSchemaValPtr prev, 
xmlSchemaValPtr cur)
Packit Service a31ea6
int	xmlSchemaValueGetAsBoolean	(xmlSchemaValPtr val)
Packit Service a31ea6
const xmlChar *	xmlSchemaValueGetAsString	(xmlSchemaValPtr val)
Packit Service a31ea6
xmlSchemaValPtr	xmlSchemaValueGetNext	(xmlSchemaValPtr cur)
Packit Service a31ea6
xmlChar *	xmlSchemaWhiteSpaceReplace	(const xmlChar * value)
Packit Service a31ea6

Description

Packit Service a31ea6

Enum xmlSchemaWhitespaceValueType

Enum xmlSchemaWhitespaceValueType {
Packit Service a31ea6
    XML_SCHEMA_WHITESPACE_UNKNOWN = 0
Packit Service a31ea6
    XML_SCHEMA_WHITESPACE_PRESERVE = 1
Packit Service a31ea6
    XML_SCHEMA_WHITESPACE_REPLACE = 2
Packit Service a31ea6
    XML_SCHEMA_WHITESPACE_COLLAPSE = 3
Packit Service a31ea6
}
Packit Service a31ea6

Function: xmlSchemaCheckFacet

int	xmlSchemaCheckFacet		(xmlSchemaFacetPtr facet, 
xmlSchemaTypePtr typeDecl,
xmlSchemaParserCtxtPtr pctxt,
const xmlChar * name)
Packit Service a31ea6

Checks and computes the values of facets.

Packit Service a31ea6
<tt>facet</tt>:the facet
<tt>typeDecl</tt>:the schema type definition
<tt>pctxt</tt>:the schema parser context or NULL
<tt>name</tt>:the optional name of the type
<tt>Returns</tt>:0 if valid, a positive error code if not valid and -1 in case of an internal or API error.

Function: xmlSchemaCleanupTypes

void	xmlSchemaCleanupTypes		(void)
Packit Service a31ea6

Cleanup the default XML Schemas type library

Packit Service a31ea6

Function: xmlSchemaCollapseString

xmlChar *	xmlSchemaCollapseString	(const xmlChar * value)
Packit Service a31ea6

Removes and normalize white spaces in the string

Packit Service a31ea6
<tt>value</tt>:a value
<tt>Returns</tt>:the new string or NULL if no change was required.

Function: xmlSchemaCompareValues

int	xmlSchemaCompareValues		(xmlSchemaValPtr x, 
xmlSchemaValPtr y)
Packit Service a31ea6

Compare 2 values

Packit Service a31ea6
<tt>x</tt>:a first value
<tt>y</tt>:a second value
<tt>Returns</tt>:-1 if x < y, 0 if x == y, 1 if x > y, 2 if x <> y, and -2 in case of error

Function: xmlSchemaCompareValuesWhtsp

int	xmlSchemaCompareValuesWhtsp	(xmlSchemaValPtr x, 
xmlSchemaWhitespaceValueType xws,
xmlSchemaValPtr y,
xmlSchemaWhitespaceValueType yws)
Packit Service a31ea6

Compare 2 values

Packit Service a31ea6
<tt>x</tt>:a first value
<tt>xws</tt>:the whitespace value of x
<tt>y</tt>:a second value
<tt>yws</tt>:the whitespace value of y
<tt>Returns</tt>:-1 if x < y, 0 if x == y, 1 if x > y, 2 if x <> y, and -2 in case of error

Function: xmlSchemaCopyValue

xmlSchemaValPtr	xmlSchemaCopyValue	(xmlSchemaValPtr val)
Packit Service a31ea6

Copies the precomputed value. This duplicates any string within.

Packit Service a31ea6
<tt>val</tt>:the precomputed value to be copied
<tt>Returns</tt>:the copy or NULL if a copy for a data-type is not implemented.

Function: xmlSchemaFreeFacet

void	xmlSchemaFreeFacet		(xmlSchemaFacetPtr facet)
Packit Service a31ea6

Deallocate a Schema Facet structure.

Packit Service a31ea6
<tt>facet</tt>:a schema facet structure

Function: xmlSchemaFreeValue

void	xmlSchemaFreeValue		(xmlSchemaValPtr value)
Packit Service a31ea6

Cleanup the default XML Schemas type library

Packit Service a31ea6
<tt>value</tt>:the value to free

Function: xmlSchemaGetBuiltInListSimpleTypeItemType

xmlSchemaTypePtr	xmlSchemaGetBuiltInListSimpleTypeItemType	(xmlSchemaTypePtr type)
Packit Service a31ea6

Lookup function

Packit Service a31ea6
<tt>type</tt>:the built-in simple type.
<tt>Returns</tt>: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)
Packit Service a31ea6

Gives you the type struct for a built-in type by its type id.

Packit Service a31ea6
<tt>type</tt>:the type of the built in type
<tt>Returns</tt>:the type if found, NULL otherwise.

Function: xmlSchemaGetCanonValue

int	xmlSchemaGetCanonValue		(xmlSchemaValPtr val, 
const xmlChar ** retValue)
Packit Service a31ea6

Get the canonical lexical representation of the value. The caller has to FREE the returned retValue. WARNING: Some value types are not supported yet, resulting in a @retValue of "???". TODO: XML Schema 1.0 does not define canonical representations for: duration, gYearMonth, gYear, gMonthDay, gMonth, gDay, anyURI, QName, NOTATION. This will be fixed in XML Schema 1.1.

Packit Service a31ea6
<tt>val</tt>:the precomputed value
<tt>retValue</tt>:the returned value
<tt>Returns</tt>:0 if the value could be built, 1 if the value type is not supported yet and -1 in case of API errors.

Function: xmlSchemaGetCanonValueWhtsp

int	xmlSchemaGetCanonValueWhtsp	(xmlSchemaValPtr val, 
const xmlChar ** retValue,
xmlSchemaWhitespaceValueType ws)
Packit Service a31ea6

Get the canonical representation of the value. The caller has to free the returned @retValue.

Packit Service a31ea6
<tt>val</tt>:the precomputed value
<tt>retValue</tt>:the returned value
<tt>ws</tt>:the whitespace type of the value
<tt>Returns</tt>:0 if the value could be built, 1 if the value type is not supported yet and -1 in case of API errors.

Function: xmlSchemaGetFacetValueAsULong

unsigned long	xmlSchemaGetFacetValueAsULong	(xmlSchemaFacetPtr facet)
Packit Service a31ea6

Extract the value of a facet

Packit Service a31ea6
<tt>facet</tt>:an schemas type facet
<tt>Returns</tt>:the value as a long

Function: xmlSchemaGetPredefinedType

xmlSchemaTypePtr	xmlSchemaGetPredefinedType	(const xmlChar * name, 
const xmlChar * ns)
Packit Service a31ea6

Lookup a type in the default XML Schemas type library

Packit Service a31ea6
<tt>name</tt>:the type name
<tt>ns</tt>:the URI of the namespace usually "http://www.w3.org/2001/XMLSchema"
<tt>Returns</tt>:the type if found, NULL otherwise

Function: xmlSchemaGetValType

xmlSchemaValType	xmlSchemaGetValType	(xmlSchemaValPtr val)
Packit Service a31ea6

Accessor for the type of a value

Packit Service a31ea6
<tt>val</tt>:a schemas value
<tt>Returns</tt>:the xmlSchemaValType of the value

Function: xmlSchemaInitTypes

void	xmlSchemaInitTypes		(void)
Packit Service a31ea6

Initialize the default XML Schemas type library

Packit Service a31ea6

Function: xmlSchemaIsBuiltInTypeFacet

int	xmlSchemaIsBuiltInTypeFacet	(xmlSchemaTypePtr type, 
int facetType)
Packit Service a31ea6

Evaluates if a specific facet can be used in conjunction with a type.

Packit Service a31ea6
<tt>type</tt>:the built-in type
<tt>facetType</tt>:the facet type
<tt>Returns</tt>: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)
Packit Service a31ea6

Allocate a new Facet structure.

Packit Service a31ea6
<tt>Returns</tt>:the newly allocated structure or NULL in case or error

Function: xmlSchemaNewNOTATIONValue

xmlSchemaValPtr	xmlSchemaNewNOTATIONValue	(const xmlChar * name, 
const xmlChar * ns)
Packit Service a31ea6

Allocate a new NOTATION value. The given values are consumed and freed with the struct.

Packit Service a31ea6
<tt>name</tt>:the notation name
<tt>ns</tt>:the notation namespace name or NULL
<tt>Returns</tt>:a pointer to the new value or NULL in case of error

Function: xmlSchemaNewQNameValue

xmlSchemaValPtr	xmlSchemaNewQNameValue	(const xmlChar * namespaceName, 
const xmlChar * localName)
Packit Service a31ea6

Allocate a new QName value. The given values are consumed and freed with the struct.

Packit Service a31ea6
<tt>namespaceName</tt>:the namespace name
<tt>localName</tt>:the local name
<tt>Returns</tt>:a pointer to the new value or NULL in case of an error.

Function: xmlSchemaNewStringValue

xmlSchemaValPtr	xmlSchemaNewStringValue	(xmlSchemaValType type, 
const xmlChar * value)
Packit Service a31ea6

Allocate a new simple type value. The type can be of XML_SCHEMAS_STRING. WARNING: This one is intended to be expanded for other string based types. We need this for anySimpleType as well. The given value is consumed and freed with the struct.

Packit Service a31ea6
<tt>type</tt>:the value type
<tt>value</tt>:the value
<tt>Returns</tt>:a pointer to the new value or NULL in case of error

Function: xmlSchemaValPredefTypeNode

int	xmlSchemaValPredefTypeNode	(xmlSchemaTypePtr type, 
const xmlChar * value,
xmlSchemaValPtr * val,
xmlNodePtr node)
Packit Service a31ea6

Check that a value conforms to the lexical space of the predefined type. if true a value is computed and returned in @val.

Packit Service a31ea6
<tt>type</tt>:the predefined type
<tt>value</tt>:the value to check
<tt>val</tt>:the return computed value
<tt>node</tt>:the node containing the value
<tt>Returns</tt>: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)
Packit Service a31ea6

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.

Packit Service a31ea6
<tt>type</tt>:the predefined type
<tt>value</tt>:the value to check
<tt>val</tt>:the return computed value
<tt>node</tt>:the node containing the value
<tt>Returns</tt>: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)
Packit Service a31ea6

Check a value against a facet condition

Packit Service a31ea6
<tt>base</tt>:the base type
<tt>facet</tt>:the facet to check
<tt>value</tt>:the lexical repr of the value to validate
<tt>val</tt>:the precomputed value
<tt>Returns</tt>:0 if the element is schemas valid, a positive error code number otherwise and -1 in case of internal or API error.

Function: xmlSchemaValidateFacetWhtsp

int	xmlSchemaValidateFacetWhtsp	(xmlSchemaFacetPtr facet, 
xmlSchemaWhitespaceValueType fws,
xmlSchemaValType valType,
const xmlChar * value,
xmlSchemaValPtr val,
xmlSchemaWhitespaceValueType ws)
Packit Service a31ea6

Check a value against a facet condition. This takes value normalization according to the specified whitespace types into account. Note that @value needs to be the *normalized* value if the facet is of type "pattern".

Packit Service a31ea6
<tt>facet</tt>:the facet to check
<tt>fws</tt>:the whitespace type of the facet's value
<tt>valType</tt>:the built-in type of the value
<tt>value</tt>:the lexical (or normalized for pattern) repr of the value to validate
<tt>val</tt>:the precomputed value
<tt>ws</tt>:the whitespace type of the value
<tt>Returns</tt>: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)
Packit Service a31ea6

Checka a value against a "length", "minLength" and "maxLength" facet; sets @length to the computed length of @value.

Packit Service a31ea6
<tt>type</tt>:the built-in type
<tt>facet</tt>:the facet to check
<tt>value</tt>:the lexical repr. of the value to be validated
<tt>val</tt>:the precomputed value
<tt>length</tt>:the actual length of the value
<tt>Returns</tt>:0 if the value is valid, a positive error code otherwise and -1 in case of an internal or API error.

Function: xmlSchemaValidateLengthFacetWhtsp

int	xmlSchemaValidateLengthFacetWhtsp	(xmlSchemaFacetPtr facet, 
xmlSchemaValType valType,
const xmlChar * value,
xmlSchemaValPtr val,
unsigned long * length,
xmlSchemaWhitespaceValueType ws)
Packit Service a31ea6

Checka a value against a "length", "minLength" and "maxLength" facet; sets @length to the computed length of @value.

Packit Service a31ea6
<tt>facet</tt>:the facet to check
<tt>valType</tt>:the built-in type
<tt>value</tt>:the lexical repr. of the value to be validated
<tt>val</tt>:the precomputed value
<tt>length</tt>:the actual length of the value
<tt>ws</tt>:the whitespace type of the value
<tt>Returns</tt>: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)
Packit Service a31ea6

Checks the value of a list simple type against a facet.

Packit Service a31ea6
<tt>facet</tt>:the facet to check
<tt>value</tt>:the lexical repr of the value to validate
<tt>actualLen</tt>:the number of list items
<tt>expectedLen</tt>:the resulting expected number of list items
<tt>Returns</tt>: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)
Packit Service a31ea6

Check that a value conforms to the lexical space of the predefined type. if true a value is computed and returned in @val.

Packit Service a31ea6
<tt>type</tt>:the predefined type
<tt>value</tt>:the value to check
<tt>val</tt>:the return computed value
<tt>Returns</tt>:0 if this validates, a positive error code number otherwise and -1 in case of internal or API error.

Function: xmlSchemaValueAppend

int	xmlSchemaValueAppend		(xmlSchemaValPtr prev, 
xmlSchemaValPtr cur)
Packit Service a31ea6

Appends a next sibling to a list of computed values.

Packit Service a31ea6
<tt>prev</tt>:the value
<tt>cur</tt>:the value to be appended
<tt>Returns</tt>:0 if succeeded and -1 on API errors.

Function: xmlSchemaValueGetAsBoolean

int	xmlSchemaValueGetAsBoolean	(xmlSchemaValPtr val)
Packit Service a31ea6

Accessor for the boolean value of a computed value.

Packit Service a31ea6
<tt>val</tt>:the value
<tt>Returns</tt>:1 if true and 0 if false, or in case of an error. Hmm.

Function: xmlSchemaValueGetAsString

const xmlChar *	xmlSchemaValueGetAsString	(xmlSchemaValPtr val)
Packit Service a31ea6

Accessor for the string value of a computed value.

Packit Service a31ea6
<tt>val</tt>:the value
<tt>Returns</tt>:the string value or NULL if there was none, or on API errors.

Function: xmlSchemaValueGetNext

xmlSchemaValPtr	xmlSchemaValueGetNext	(xmlSchemaValPtr cur)
Packit Service a31ea6

Accessor for the next sibling of a list of computed values.

Packit Service a31ea6
<tt>cur</tt>:the value
<tt>Returns</tt>:the next value or NULL if there was none, or on API errors.

Function: xmlSchemaWhiteSpaceReplace

xmlChar *	xmlSchemaWhiteSpaceReplace	(const xmlChar * value)
Packit Service a31ea6

Replaces 0xd, 0x9 and 0xa with a space.

Packit Service a31ea6
<tt>value</tt>:a value
<tt>Returns</tt>:the new string or NULL if no change was required.

Daniel Veillard

</body></html>