blob: 35d48d414bea52954ddafc51484f379bce3b9f94 [file] [log] [blame]
Daniel Veillard4255d502002-04-16 15:50:10 +00001/*
Daniel Veillardbe586972003-11-18 20:56:51 +00002 * Summary: implementation of XML Schema Datatypes
3 * Description: module providing the XML Schema Datatypes implementation
4 * both definition and validity checking
Daniel Veillard4255d502002-04-16 15:50:10 +00005 *
Daniel Veillardbe586972003-11-18 20:56:51 +00006 * Copy: See Copyright for the status of this software.
Daniel Veillard4255d502002-04-16 15:50:10 +00007 *
Daniel Veillardbe586972003-11-18 20:56:51 +00008 * Author: Daniel Veillard
Daniel Veillard4255d502002-04-16 15:50:10 +00009 */
10
11
12#ifndef __XML_SCHEMA_TYPES_H__
13#define __XML_SCHEMA_TYPES_H__
14
Daniel Veillard4255d502002-04-16 15:50:10 +000015#include <libxml/xmlversion.h>
Igor Zlatkovic7ae91bc2002-11-08 17:18:52 +000016
Daniel Veillard4255d502002-04-16 15:50:10 +000017#ifdef LIBXML_SCHEMAS_ENABLED
18
19#include <libxml/schemasInternals.h>
Daniel Veillard8bc6cf92003-02-27 17:42:22 +000020#include <libxml/xmlschemas.h>
Daniel Veillard4255d502002-04-16 15:50:10 +000021
22#ifdef __cplusplus
23extern "C" {
24#endif
25
Kasimier T. Buchcik6e224f12005-02-17 11:10:44 +000026typedef enum {
27 XML_SCHEMA_WHITESPACE_UNKNOWN = 0,
28 XML_SCHEMA_WHITESPACE_PRESERVE = 1,
29 XML_SCHEMA_WHITESPACE_REPLACE = 2,
30 XML_SCHEMA_WHITESPACE_COLLAPSE = 3
31} xmlSchemaWhitespaceValueType;
32
Daniel Veillardf8e3db02012-09-11 13:26:36 +080033XMLPUBFUN void XMLCALL
34 xmlSchemaInitTypes (void);
35XMLPUBFUN void XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000036 xmlSchemaCleanupTypes (void);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080037XMLPUBFUN xmlSchemaTypePtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000038 xmlSchemaGetPredefinedType (const xmlChar *name,
Daniel Veillard4255d502002-04-16 15:50:10 +000039 const xmlChar *ns);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080040XMLPUBFUN int XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000041 xmlSchemaValidatePredefinedType (xmlSchemaTypePtr type,
Daniel Veillard4255d502002-04-16 15:50:10 +000042 const xmlChar *value,
43 xmlSchemaValPtr *val);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080044XMLPUBFUN int XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000045 xmlSchemaValPredefTypeNode (xmlSchemaTypePtr type,
Daniel Veillardc3da18a2003-03-18 00:31:04 +000046 const xmlChar *value,
47 xmlSchemaValPtr *val,
48 xmlNodePtr node);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080049XMLPUBFUN int XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000050 xmlSchemaValidateFacet (xmlSchemaTypePtr base,
Daniel Veillard4255d502002-04-16 15:50:10 +000051 xmlSchemaFacetPtr facet,
52 const xmlChar *value,
Kasimier T. Buchcik6c81d0e2005-03-15 14:58:11 +000053 xmlSchemaValPtr val);
Kasimier T. Buchcik6c81d0e2005-03-15 14:58:11 +000054XMLPUBFUN int XMLCALL
55 xmlSchemaValidateFacetWhtsp (xmlSchemaFacetPtr facet,
56 xmlSchemaWhitespaceValueType fws,
Daniel Veillardf8e3db02012-09-11 13:26:36 +080057 xmlSchemaValType valType,
Kasimier T. Buchcik6c81d0e2005-03-15 14:58:11 +000058 const xmlChar *value,
Kasimier T. Buchcik478d6932005-03-16 16:29:18 +000059 xmlSchemaValPtr val,
Kasimier T. Buchcik6c81d0e2005-03-15 14:58:11 +000060 xmlSchemaWhitespaceValueType ws);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080061XMLPUBFUN void XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000062 xmlSchemaFreeValue (xmlSchemaValPtr val);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080063XMLPUBFUN xmlSchemaFacetPtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000064 xmlSchemaNewFacet (void);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080065XMLPUBFUN int XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000066 xmlSchemaCheckFacet (xmlSchemaFacetPtr facet,
Daniel Veillard8bc6cf92003-02-27 17:42:22 +000067 xmlSchemaTypePtr typeDecl,
68 xmlSchemaParserCtxtPtr ctxt,
69 const xmlChar *name);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080070XMLPUBFUN void XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000071 xmlSchemaFreeFacet (xmlSchemaFacetPtr facet);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080072XMLPUBFUN int XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000073 xmlSchemaCompareValues (xmlSchemaValPtr x,
Daniel Veillard80b19092003-03-28 13:29:53 +000074 xmlSchemaValPtr y);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080075XMLPUBFUN xmlSchemaTypePtr XMLCALL
Kasimier T. Buchcik91feaf82004-11-12 14:04:58 +000076 xmlSchemaGetBuiltInListSimpleTypeItemType (xmlSchemaTypePtr type);
Daniel Veillard01fa6152004-06-29 17:04:39 +000077XMLPUBFUN int XMLCALL
Kasimier T. Buchcik91feaf82004-11-12 14:04:58 +000078 xmlSchemaValidateListSimpleTypeFacet (xmlSchemaFacetPtr facet,
79 const xmlChar *value,
80 unsigned long actualLen,
81 unsigned long *expectedLen);
Daniel Veillard01fa6152004-06-29 17:04:39 +000082XMLPUBFUN xmlSchemaTypePtr XMLCALL
Kasimier T. Buchcik91feaf82004-11-12 14:04:58 +000083 xmlSchemaGetBuiltInType (xmlSchemaValType type);
Daniel Veillard01fa6152004-06-29 17:04:39 +000084XMLPUBFUN int XMLCALL
Daniel Veillardf8e3db02012-09-11 13:26:36 +080085 xmlSchemaIsBuiltInTypeFacet (xmlSchemaTypePtr type,
Kasimier T. Buchcik91feaf82004-11-12 14:04:58 +000086 int facetType);
Daniel Veillardc0826a72004-08-10 14:17:33 +000087XMLPUBFUN xmlChar * XMLCALL
Kasimier T. Buchcik91feaf82004-11-12 14:04:58 +000088 xmlSchemaCollapseString (const xmlChar *value);
89XMLPUBFUN xmlChar * XMLCALL
90 xmlSchemaWhiteSpaceReplace (const xmlChar *value);
Daniel Veillardc0826a72004-08-10 14:17:33 +000091XMLPUBFUN unsigned long XMLCALL
Kasimier T. Buchcik91feaf82004-11-12 14:04:58 +000092 xmlSchemaGetFacetValueAsULong (xmlSchemaFacetPtr facet);
Daniel Veillardc0826a72004-08-10 14:17:33 +000093XMLPUBFUN int XMLCALL
Daniel Veillardf8e3db02012-09-11 13:26:36 +080094 xmlSchemaValidateLengthFacet (xmlSchemaTypePtr type,
Kasimier T. Buchcik91feaf82004-11-12 14:04:58 +000095 xmlSchemaFacetPtr facet,
96 const xmlChar *value,
97 xmlSchemaValPtr val,
Kasimier T. Buchcik478d6932005-03-16 16:29:18 +000098 unsigned long *length);
99XMLPUBFUN int XMLCALL
100 xmlSchemaValidateLengthFacetWhtsp(xmlSchemaFacetPtr facet,
101 xmlSchemaValType valType,
102 const xmlChar *value,
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800103 xmlSchemaValPtr val,
Kasimier T. Buchcik478d6932005-03-16 16:29:18 +0000104 unsigned long *length,
105 xmlSchemaWhitespaceValueType ws);
Daniel Veillardc0826a72004-08-10 14:17:33 +0000106XMLPUBFUN int XMLCALL
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800107 xmlSchemaValPredefTypeNodeNoNorm(xmlSchemaTypePtr type,
Kasimier T. Buchcik91feaf82004-11-12 14:04:58 +0000108 const xmlChar *value,
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800109 xmlSchemaValPtr *val,
Kasimier T. Buchcik91feaf82004-11-12 14:04:58 +0000110 xmlNodePtr node);
Kasimier T. Buchcik6e224f12005-02-17 11:10:44 +0000111XMLPUBFUN int XMLCALL
112 xmlSchemaGetCanonValue (xmlSchemaValPtr val,
113 const xmlChar **retValue);
Kasimier T. Buchcikc872afb2005-04-18 10:57:04 +0000114XMLPUBFUN int XMLCALL
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800115 xmlSchemaGetCanonValueWhtsp (xmlSchemaValPtr val,
Kasimier T. Buchcikc872afb2005-04-18 10:57:04 +0000116 const xmlChar **retValue,
117 xmlSchemaWhitespaceValueType ws);
Kasimier T. Buchcik4efd90d2005-06-09 10:32:53 +0000118XMLPUBFUN int XMLCALL
119 xmlSchemaValueAppend (xmlSchemaValPtr prev,
120 xmlSchemaValPtr cur);
121XMLPUBFUN xmlSchemaValPtr XMLCALL
122 xmlSchemaValueGetNext (xmlSchemaValPtr cur);
123XMLPUBFUN const xmlChar * XMLCALL
124 xmlSchemaValueGetAsString (xmlSchemaValPtr val);
125XMLPUBFUN int XMLCALL
126 xmlSchemaValueGetAsBoolean (xmlSchemaValPtr val);
Kasimier T. Buchcik6e224f12005-02-17 11:10:44 +0000127XMLPUBFUN xmlSchemaValPtr XMLCALL
128 xmlSchemaNewStringValue (xmlSchemaValType type,
129 const xmlChar *value);
Kasimier T. Buchcikb06b4de2005-02-17 19:00:23 +0000130XMLPUBFUN xmlSchemaValPtr XMLCALL
131 xmlSchemaNewNOTATIONValue (const xmlChar *name,
132 const xmlChar *ns);
Kasimier T. Buchcik4efd90d2005-06-09 10:32:53 +0000133XMLPUBFUN xmlSchemaValPtr XMLCALL
134 xmlSchemaNewQNameValue (const xmlChar *namespaceName,
135 const xmlChar *localName);
Kasimier T. Buchcik6e224f12005-02-17 11:10:44 +0000136XMLPUBFUN int XMLCALL
137 xmlSchemaCompareValuesWhtsp (xmlSchemaValPtr x,
138 xmlSchemaWhitespaceValueType xws,
139 xmlSchemaValPtr y,
Kasimier T. Buchcik285ebab2005-03-04 18:04:59 +0000140 xmlSchemaWhitespaceValueType yws);
141XMLPUBFUN xmlSchemaValPtr XMLCALL
Kasimier T. Buchcik6c81d0e2005-03-15 14:58:11 +0000142 xmlSchemaCopyValue (xmlSchemaValPtr val);
Kasimier T. Buchcik478d6932005-03-16 16:29:18 +0000143XMLPUBFUN xmlSchemaValType XMLCALL
144 xmlSchemaGetValType (xmlSchemaValPtr val);
Daniel Veillard4255d502002-04-16 15:50:10 +0000145
146#ifdef __cplusplus
147}
148#endif
149
150#endif /* LIBXML_SCHEMAS_ENABLED */
151#endif /* __XML_SCHEMA_TYPES_H__ */