| 1 |
/** |
| 2 |
* @file |
| 3 |
* |
| 4 |
* @brief implementation of XML Schema Datatypes |
| 5 |
* |
| 6 |
* module providing the XML Schema Datatypes implementation |
| 7 |
* both definition and validity checking |
| 8 |
* |
| 9 |
* @copyright See Copyright for the status of this software. |
| 10 |
* |
| 11 |
* @author Daniel Veillard |
| 12 |
*/ |
| 13 |
|
| 14 |
|
| 15 |
#ifndef __XML_SCHEMA_TYPES_H__ |
| 16 |
#define __XML_SCHEMA_TYPES_H__ |
| 17 |
|
| 18 |
#include <libxml/xmlversion.h> |
| 19 |
|
| 20 |
#ifdef LIBXML_SCHEMAS_ENABLED |
| 21 |
|
| 22 |
#include <libxml/schemasInternals.h> |
| 23 |
#include <libxml/xmlschemas.h> |
| 24 |
|
| 25 |
#ifdef __cplusplus |
| 26 |
extern "C" { |
| 27 |
#endif |
| 28 |
|
| 29 |
/** |
| 30 |
* Schema whitespace value type |
| 31 |
*/ |
| 32 |
typedef enum { |
| 33 |
XML_SCHEMA_WHITESPACE_UNKNOWN = 0, |
| 34 |
XML_SCHEMA_WHITESPACE_PRESERVE = 1, |
| 35 |
XML_SCHEMA_WHITESPACE_REPLACE = 2, |
| 36 |
XML_SCHEMA_WHITESPACE_COLLAPSE = 3 |
| 37 |
} xmlSchemaWhitespaceValueType; |
| 38 |
|
| 39 |
XMLPUBFUN int |
| 40 |
xmlSchemaInitTypes (void); |
| 41 |
XML_DEPRECATED |
| 42 |
XMLPUBFUN void |
| 43 |
xmlSchemaCleanupTypes (void); |
| 44 |
XMLPUBFUN xmlSchemaType * |
| 45 |
xmlSchemaGetPredefinedType (const xmlChar *name, |
| 46 |
const xmlChar *ns); |
| 47 |
XMLPUBFUN int |
| 48 |
xmlSchemaValidatePredefinedType (xmlSchemaType *type, |
| 49 |
const xmlChar *value, |
| 50 |
xmlSchemaVal **val); |
| 51 |
XMLPUBFUN int |
| 52 |
xmlSchemaValPredefTypeNode (xmlSchemaType *type, |
| 53 |
const xmlChar *value, |
| 54 |
xmlSchemaVal **val, |
| 55 |
xmlNode *node); |
| 56 |
XMLPUBFUN int |
| 57 |
xmlSchemaValidateFacet (xmlSchemaType *base, |
| 58 |
xmlSchemaFacet *facet, |
| 59 |
const xmlChar *value, |
| 60 |
xmlSchemaVal *val); |
| 61 |
XMLPUBFUN int |
| 62 |
xmlSchemaValidateFacetWhtsp (xmlSchemaFacet *facet, |
| 63 |
xmlSchemaWhitespaceValueType fws, |
| 64 |
xmlSchemaValType valType, |
| 65 |
const xmlChar *value, |
| 66 |
xmlSchemaVal *val, |
| 67 |
xmlSchemaWhitespaceValueType ws); |
| 68 |
XMLPUBFUN void |
| 69 |
xmlSchemaFreeValue (xmlSchemaVal *val); |
| 70 |
XMLPUBFUN xmlSchemaFacet * |
| 71 |
xmlSchemaNewFacet (void); |
| 72 |
XMLPUBFUN int |
| 73 |
xmlSchemaCheckFacet (xmlSchemaFacet *facet, |
| 74 |
xmlSchemaType *typeDecl, |
| 75 |
xmlSchemaParserCtxt *ctxt, |
| 76 |
const xmlChar *name); |
| 77 |
XMLPUBFUN void |
| 78 |
xmlSchemaFreeFacet (xmlSchemaFacet *facet); |
| 79 |
XMLPUBFUN int |
| 80 |
xmlSchemaCompareValues (xmlSchemaVal *x, |
| 81 |
xmlSchemaVal *y); |
| 82 |
XMLPUBFUN xmlSchemaType * |
| 83 |
xmlSchemaGetBuiltInListSimpleTypeItemType (xmlSchemaType *type); |
| 84 |
XMLPUBFUN int |
| 85 |
xmlSchemaValidateListSimpleTypeFacet (xmlSchemaFacet *facet, |
| 86 |
const xmlChar *value, |
| 87 |
unsigned long actualLen, |
| 88 |
unsigned long *expectedLen); |
| 89 |
XMLPUBFUN xmlSchemaType * |
| 90 |
xmlSchemaGetBuiltInType (xmlSchemaValType type); |
| 91 |
XMLPUBFUN int |
| 92 |
xmlSchemaIsBuiltInTypeFacet (xmlSchemaType *type, |
| 93 |
int facetType); |
| 94 |
XMLPUBFUN xmlChar * |
| 95 |
xmlSchemaCollapseString (const xmlChar *value); |
| 96 |
XMLPUBFUN xmlChar * |
| 97 |
xmlSchemaWhiteSpaceReplace (const xmlChar *value); |
| 98 |
XMLPUBFUN unsigned long |
| 99 |
xmlSchemaGetFacetValueAsULong (xmlSchemaFacet *facet); |
| 100 |
XMLPUBFUN int |
| 101 |
xmlSchemaValidateLengthFacet (xmlSchemaType *type, |
| 102 |
xmlSchemaFacet *facet, |
| 103 |
const xmlChar *value, |
| 104 |
xmlSchemaVal *val, |
| 105 |
unsigned long *length); |
| 106 |
XMLPUBFUN int |
| 107 |
xmlSchemaValidateLengthFacetWhtsp(xmlSchemaFacet *facet, |
| 108 |
xmlSchemaValType valType, |
| 109 |
const xmlChar *value, |
| 110 |
xmlSchemaVal *val, |
| 111 |
unsigned long *length, |
| 112 |
xmlSchemaWhitespaceValueType ws); |
| 113 |
XMLPUBFUN int |
| 114 |
xmlSchemaValPredefTypeNodeNoNorm(xmlSchemaType *type, |
| 115 |
const xmlChar *value, |
| 116 |
xmlSchemaVal **val, |
| 117 |
xmlNode *node); |
| 118 |
XMLPUBFUN int |
| 119 |
xmlSchemaGetCanonValue (xmlSchemaVal *val, |
| 120 |
const xmlChar **retValue); |
| 121 |
XMLPUBFUN int |
| 122 |
xmlSchemaGetCanonValueWhtsp (xmlSchemaVal *val, |
| 123 |
const xmlChar **retValue, |
| 124 |
xmlSchemaWhitespaceValueType ws); |
| 125 |
XMLPUBFUN int |
| 126 |
xmlSchemaValueAppend (xmlSchemaVal *prev, |
| 127 |
xmlSchemaVal *cur); |
| 128 |
XMLPUBFUN xmlSchemaVal * |
| 129 |
xmlSchemaValueGetNext (xmlSchemaVal *cur); |
| 130 |
XMLPUBFUN const xmlChar * |
| 131 |
xmlSchemaValueGetAsString (xmlSchemaVal *val); |
| 132 |
XMLPUBFUN int |
| 133 |
xmlSchemaValueGetAsBoolean (xmlSchemaVal *val); |
| 134 |
XMLPUBFUN xmlSchemaVal * |
| 135 |
xmlSchemaNewStringValue (xmlSchemaValType type, |
| 136 |
const xmlChar *value); |
| 137 |
XMLPUBFUN xmlSchemaVal * |
| 138 |
xmlSchemaNewNOTATIONValue (const xmlChar *name, |
| 139 |
const xmlChar *ns); |
| 140 |
XMLPUBFUN xmlSchemaVal * |
| 141 |
xmlSchemaNewQNameValue (const xmlChar *namespaceName, |
| 142 |
const xmlChar *localName); |
| 143 |
XMLPUBFUN int |
| 144 |
xmlSchemaCompareValuesWhtsp (xmlSchemaVal *x, |
| 145 |
xmlSchemaWhitespaceValueType xws, |
| 146 |
xmlSchemaVal *y, |
| 147 |
xmlSchemaWhitespaceValueType yws); |
| 148 |
XMLPUBFUN xmlSchemaVal * |
| 149 |
xmlSchemaCopyValue (xmlSchemaVal *val); |
| 150 |
XMLPUBFUN xmlSchemaValType |
| 151 |
xmlSchemaGetValType (xmlSchemaVal *val); |
| 152 |
|
| 153 |
#ifdef __cplusplus |
| 154 |
} |
| 155 |
#endif |
| 156 |
|
| 157 |
#endif /* LIBXML_SCHEMAS_ENABLED */ |
| 158 |
#endif /* __XML_SCHEMA_TYPES_H__ */ |