|
libxml2
|
implementation of XML Schema Datatypes More...
Enumerations | |
| enum | xmlSchemaWhitespaceValueType |
| Schema whitespace value type. | |
Functions | |
| int | xmlSchemaInitTypes (void) |
| Initialize the default XML Schemas type library. | |
| void | xmlSchemaCleanupTypes (void) |
| Cleanup the default XML Schemas type library. | |
| xmlSchemaType * | xmlSchemaGetPredefinedType (const xmlChar *name, const xmlChar *ns) |
| Lookup a type in the default XML Schemas type library. | |
| int | xmlSchemaValidatePredefinedType (xmlSchemaType *type, const xmlChar *value, xmlSchemaVal **val) |
| Check that a value conforms to the lexical space of the predefined type. | |
| int | xmlSchemaValPredefTypeNode (xmlSchemaType *type, const xmlChar *value, xmlSchemaVal **val, xmlNode *node) |
| Check that a value conforms to the lexical space of the predefined type. | |
| int | xmlSchemaValidateFacet (xmlSchemaType *base, xmlSchemaFacet *facet, const xmlChar *value, xmlSchemaVal *val) |
| Check a value against a facet condition. | |
| int | xmlSchemaValidateFacetWhtsp (xmlSchemaFacet *facet, xmlSchemaWhitespaceValueType fws, xmlSchemaValType valType, const xmlChar *value, xmlSchemaVal *val, xmlSchemaWhitespaceValueType ws) |
| Check a value against a facet condition. | |
| void | xmlSchemaFreeValue (xmlSchemaVal *val) |
| Cleanup the default XML Schemas type library. | |
| xmlSchemaFacet * | xmlSchemaNewFacet (void) |
| Allocate a new Facet structure. | |
| int | xmlSchemaCheckFacet (xmlSchemaFacet *facet, xmlSchemaType *typeDecl, xmlSchemaParserCtxt *ctxt, const xmlChar *name) |
| Checks and computes the values of facets. | |
| void | xmlSchemaFreeFacet (xmlSchemaFacet *facet) |
| Deallocate a Schema Facet structure. | |
| int | xmlSchemaCompareValues (xmlSchemaVal *x, xmlSchemaVal *y) |
| Compare 2 values. | |
| xmlSchemaType * | xmlSchemaGetBuiltInListSimpleTypeItemType (xmlSchemaType *type) |
| Lookup function. | |
| int | xmlSchemaValidateListSimpleTypeFacet (xmlSchemaFacet *facet, const xmlChar *value, unsigned long actualLen, unsigned long *expectedLen) |
| Checks the value of a list simple type against a facet. | |
| xmlSchemaType * | xmlSchemaGetBuiltInType (xmlSchemaValType type) |
| Gives you the type struct for a built-in type by its type id. | |
| int | xmlSchemaIsBuiltInTypeFacet (xmlSchemaType *type, int facetType) |
| Evaluates if a specific facet can be used in conjunction with a type. | |
| xmlChar * | xmlSchemaCollapseString (const xmlChar *value) |
| Removes and normalize white spaces in the string. | |
| xmlChar * | xmlSchemaWhiteSpaceReplace (const xmlChar *value) |
| Replaces 0xd, 0x9 and 0xa with a space. | |
| unsigned long | xmlSchemaGetFacetValueAsULong (xmlSchemaFacet *facet) |
| Extract the value of a facet. | |
| int | xmlSchemaValidateLengthFacet (xmlSchemaType *type, xmlSchemaFacet *facet, const xmlChar *value, xmlSchemaVal *val, unsigned long *length) |
| Checka a value against a "length", "minLength" and "maxLength" facet; sets length to the computed length of value. | |
| int | xmlSchemaValidateLengthFacetWhtsp (xmlSchemaFacet *facet, xmlSchemaValType valType, const xmlChar *value, xmlSchemaVal *val, unsigned long *length, xmlSchemaWhitespaceValueType ws) |
| Checka a value against a "length", "minLength" and "maxLength" facet; sets length to the computed length of value. | |
| int | xmlSchemaValPredefTypeNodeNoNorm (xmlSchemaType *type, const xmlChar *value, xmlSchemaVal **val, xmlNode *node) |
| Check that a value conforms to the lexical space of the predefined type. | |
| int | xmlSchemaGetCanonValue (xmlSchemaVal *val, const xmlChar **retValue) |
| Get the canonical lexical representation of the value. | |
| int | xmlSchemaGetCanonValueWhtsp (xmlSchemaVal *val, const xmlChar **retValue, xmlSchemaWhitespaceValueType ws) |
| Get the canonical representation of the value. | |
| int | xmlSchemaValueAppend (xmlSchemaVal *prev, xmlSchemaVal *cur) |
| Appends a next sibling to a list of computed values. | |
| xmlSchemaVal * | xmlSchemaValueGetNext (xmlSchemaVal *cur) |
| Accessor for the next sibling of a list of computed values. | |
| const xmlChar * | xmlSchemaValueGetAsString (xmlSchemaVal *val) |
| Accessor for the string value of a computed value. | |
| int | xmlSchemaValueGetAsBoolean (xmlSchemaVal *val) |
| Accessor for the boolean value of a computed value. | |
| xmlSchemaVal * | xmlSchemaNewStringValue (xmlSchemaValType type, const xmlChar *value) |
| Allocate a new simple type value. | |
| xmlSchemaVal * | xmlSchemaNewNOTATIONValue (const xmlChar *name, const xmlChar *ns) |
| Allocate a new NOTATION value. | |
| xmlSchemaVal * | xmlSchemaNewQNameValue (const xmlChar *namespaceName, const xmlChar *localName) |
| Allocate a new QName value. | |
| int | xmlSchemaCompareValuesWhtsp (xmlSchemaVal *x, xmlSchemaWhitespaceValueType xws, xmlSchemaVal *y, xmlSchemaWhitespaceValueType yws) |
| Compare 2 values. | |
| xmlSchemaVal * | xmlSchemaCopyValue (xmlSchemaVal *val) |
| Copies the precomputed value. | |
| xmlSchemaValType | xmlSchemaGetValType (xmlSchemaVal *val) |
| Accessor for the type of a value. | |
implementation of XML Schema Datatypes
module providing the XML Schema Datatypes implementation both definition and validity checking
| int xmlSchemaCheckFacet | ( | xmlSchemaFacet * | facet, |
| xmlSchemaType * | typeDecl, | ||
| xmlSchemaParserCtxt * | pctxt, | ||
| const xmlChar * | name ) |
Checks and computes the values of facets.
| facet | the facet |
| typeDecl | the schema type definition |
| pctxt | the schema parser context or NULL |
| name | the optional name of the type |
| void xmlSchemaCleanupTypes | ( | void | ) |
Cleanup the default XML Schemas type library.
Removes and normalize white spaces in the string.
| value | a value |
| int xmlSchemaCompareValues | ( | xmlSchemaVal * | x, |
| xmlSchemaVal * | y ) |
Compare 2 values.
| x | a first value |
| y | a second value |
| int xmlSchemaCompareValuesWhtsp | ( | xmlSchemaVal * | x, |
| xmlSchemaWhitespaceValueType | xws, | ||
| xmlSchemaVal * | y, | ||
| xmlSchemaWhitespaceValueType | yws ) |
Compare 2 values.
| x | a first value |
| xws | the whitespace value of x |
| y | a second value |
| yws | the whitespace value of y |
| xmlSchemaVal * xmlSchemaCopyValue | ( | xmlSchemaVal * | val | ) |
Copies the precomputed value.
This duplicates any string within.
| val | the precomputed value to be copied |
| void xmlSchemaFreeFacet | ( | xmlSchemaFacet * | facet | ) |
Deallocate a Schema Facet structure.
| facet | a schema facet structure |
| void xmlSchemaFreeValue | ( | xmlSchemaVal * | value | ) |
Cleanup the default XML Schemas type library.
| value | the value to free |
| xmlSchemaType * xmlSchemaGetBuiltInListSimpleTypeItemType | ( | xmlSchemaType * | type | ) |
Lookup function.
| type | the built-in simple type. |
| xmlSchemaType * 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 |
| int xmlSchemaGetCanonValue | ( | xmlSchemaVal * | val, |
| const xmlChar ** | retValue ) |
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.
| val | the precomputed value |
| retValue | the returned value |
| int xmlSchemaGetCanonValueWhtsp | ( | xmlSchemaVal * | val, |
| const xmlChar ** | retValue, | ||
| xmlSchemaWhitespaceValueType | ws ) |
Get the canonical representation of the value.
The caller has to free the returned retValue.
| val | the precomputed value |
| retValue | the returned value |
| ws | the whitespace type of the value |
| unsigned long xmlSchemaGetFacetValueAsULong | ( | xmlSchemaFacet * | facet | ) |
Extract the value of a facet.
| facet | an schemas type facet |
| xmlSchemaType * 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" |
| xmlSchemaValType xmlSchemaGetValType | ( | xmlSchemaVal * | val | ) |
Accessor for the type of a value.
| val | a schemas value |
| int xmlSchemaInitTypes | ( | void | ) |
Initialize the default XML Schemas type library.
| int xmlSchemaIsBuiltInTypeFacet | ( | xmlSchemaType * | 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 |
| xmlSchemaFacet * xmlSchemaNewFacet | ( | void | ) |
Allocate a new Facet structure.
| xmlSchemaVal * xmlSchemaNewNOTATIONValue | ( | const xmlChar * | name, |
| const xmlChar * | ns ) |
Allocate a new NOTATION value.
The given values are consumed and freed with the struct.
| name | the notation name |
| ns | the notation namespace name or NULL |
| xmlSchemaVal * xmlSchemaNewQNameValue | ( | const xmlChar * | namespaceName, |
| const xmlChar * | localName ) |
Allocate a new QName value.
The given values are consumed and freed with the struct.
| namespaceName | the namespace name |
| localName | the local name |
| xmlSchemaVal * xmlSchemaNewStringValue | ( | xmlSchemaValType | type, |
| const xmlChar * | value ) |
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.
| type | the value type |
| value | the value |
| int xmlSchemaValidateFacet | ( | xmlSchemaType * | base, |
| xmlSchemaFacet * | facet, | ||
| const xmlChar * | value, | ||
| xmlSchemaVal * | 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 |
| int xmlSchemaValidateFacetWhtsp | ( | xmlSchemaFacet * | facet, |
| xmlSchemaWhitespaceValueType | fws, | ||
| xmlSchemaValType | valType, | ||
| const xmlChar * | value, | ||
| xmlSchemaVal * | val, | ||
| xmlSchemaWhitespaceValueType | ws ) |
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".
| facet | the facet to check |
| fws | the whitespace type of the facet's value |
| valType | the built-in type of the value |
| value | the lexical (or normalized for pattern) repr of the value to validate |
| val | the precomputed value |
| ws | the whitespace type of the value |
| int xmlSchemaValidateLengthFacet | ( | xmlSchemaType * | type, |
| xmlSchemaFacet * | facet, | ||
| const xmlChar * | value, | ||
| xmlSchemaVal * | 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 |
| int xmlSchemaValidateLengthFacetWhtsp | ( | xmlSchemaFacet * | facet, |
| xmlSchemaValType | valType, | ||
| const xmlChar * | value, | ||
| xmlSchemaVal * | val, | ||
| unsigned long * | length, | ||
| xmlSchemaWhitespaceValueType | ws ) |
Checka a value against a "length", "minLength" and "maxLength" facet; sets length to the computed length of value.
| facet | the facet to check |
| valType | the built-in type |
| value | the lexical repr. of the value to be validated |
| val | the precomputed value |
| ws | the whitespace type of the value |
| length | the actual length of the value |
| int xmlSchemaValidateListSimpleTypeFacet | ( | xmlSchemaFacet * | 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 |
| int xmlSchemaValidatePredefinedType | ( | xmlSchemaType * | type, |
| const xmlChar * | value, | ||
| xmlSchemaVal ** | 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 |
| int xmlSchemaValPredefTypeNode | ( | xmlSchemaType * | type, |
| const xmlChar * | value, | ||
| xmlSchemaVal ** | val, | ||
| xmlNode * | 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 |
| int xmlSchemaValPredefTypeNodeNoNorm | ( | xmlSchemaType * | type, |
| const xmlChar * | value, | ||
| xmlSchemaVal ** | val, | ||
| xmlNode * | 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 |
| int xmlSchemaValueAppend | ( | xmlSchemaVal * | prev, |
| xmlSchemaVal * | cur ) |
Appends a next sibling to a list of computed values.
| prev | the value |
| cur | the value to be appended |
| int xmlSchemaValueGetAsBoolean | ( | xmlSchemaVal * | val | ) |
Accessor for the boolean value of a computed value.
| val | the value |
| const xmlChar * xmlSchemaValueGetAsString | ( | xmlSchemaVal * | val | ) |
Accessor for the string value of a computed value.
| val | the value |
| xmlSchemaVal * xmlSchemaValueGetNext | ( | xmlSchemaVal * | cur | ) |
Accessor for the next sibling of a list of computed values.
| cur | the value |