1 * Summary: incomplete XML Schemas structure implementation 2 * Description: interface to the XML Schemas handling and schema validity 3 * checking, it is incomplete right now. 4 * 5 * Copy: See Copyright for the status of this software. 6 * 7 * Author: Patrick Monnerat <pm@datasphere.ch>, DATASPHERE S.A. 8 9 /if not defined(XML_SCHEMA_H__) 10 /define XML_SCHEMA_H__ 11 12 /include "libxmlrpg/xmlversion" 13 14 /if defined(LIBXML_SCHEMAS_ENABLED) 15 16 /include "libxmlrpg/xmlTypesC" 17 /include "libxmlrpg/tree" 18 19 * This error codes are obsolete; not used any more. 20 21 d xmlSchemaValidError... 22 d s based(######typedef######) 23 d like(xmlCenum) 24 d XML_SCHEMAS_ERR_OK... 25 d c 0 26 d XML_SCHEMAS_ERR_NOROOT... 27 d c 1 28 d XML_SCHEMAS_ERR_UNDECLAREDELEM... 29 d c 2 30 d XML_SCHEMAS_ERR_NOTTOPLEVEL... 31 d c 3 32 d XML_SCHEMAS_ERR_MISSING... 33 d c 4 34 d XML_SCHEMAS_ERR_WRONGELEM... 35 d c 5 36 d XML_SCHEMAS_ERR_NOTYPE... 37 d c 6 38 d XML_SCHEMAS_ERR_NOROLLBACK... 39 d c 7 40 d XML_SCHEMAS_ERR_ISABSTRACT... 41 d c 8 42 d XML_SCHEMAS_ERR_NOTEMPTY... 43 d c 9 44 d XML_SCHEMAS_ERR_ELEMCONT... 45 d c 10 46 d XML_SCHEMAS_ERR_HAVEDEFAULT... 47 d c 11 48 d XML_SCHEMAS_ERR_NOTNILLABLE... 49 d c 12 50 d XML_SCHEMAS_ERR_EXTRACONTENT... 51 d c 13 52 d XML_SCHEMAS_ERR_INVALIDATTR... 53 d c 14 54 d XML_SCHEMAS_ERR_INVALIDELEM... 55 d c 15 56 d XML_SCHEMAS_ERR_NOTDETERMINIST... 57 d c 16 58 d XML_SCHEMAS_ERR_CONSTRUCT... 59 d c 17 60 d XML_SCHEMAS_ERR_INTERNAL... 61 d c 18 62 d XML_SCHEMAS_ERR_NOTSIMPLE... 63 d c 19 64 d XML_SCHEMAS_ERR_ATTRUNKNOWN... 65 d c 20 66 d XML_SCHEMAS_ERR_ATTRINVALID... 67 d c 21 68 d XML_SCHEMAS_ERR_VALUE... 69 d c 22 70 d XML_SCHEMAS_ERR_FACET... 71 d c 23 72 d XML_SCHEMAS_ERR_... 73 d c 24 74 d XML_SCHEMAS_ERR_XXX... 75 d c 25 76 77 * ATTENTION: Change xmlSchemaSetValidOptions's check 78 * for invalid values, if adding to the validation 79 * options below. 80 81 * xmlSchemaValidOption: 82 * 83 * This is the set of XML Schema validation options. 84 85 d xmlSchemaValidOption... 86 d s based(######typedef######) 87 d like(xmlCenum) 88 * 89 * Default/fixed: create an attribute node 90 * or an element's text node on the instance. 91 * 92 d XML_SCHEMA_VAL_VC_I_CREATE... 93 d c X'0001' 94 /if defined(DISABLED) 95 * 96 * assemble schemata using 97 * xsi:schemaLocation and 98 * xsi:noNamespaceSchemaLocation 99 * 100 d XML_SCHEMA_VAL_XSI_ASSEMBLE... 101 d c X'0002' 102 /endif 103 104 * The schemas related types are kept internal 105 106 d xmlSchemaPtr s * based(######typedef######) 107 108 * xmlSchemaValidityErrorFunc: 109 * @ctx: the validation context 110 * @msg: the message 111 * @...: extra arguments 112 * 113 * Signature of an error callback from an XSD validation 114 115 d xmlSchemaValidityErrorFunc... 116 d s * based(######typedef######) 117 d procptr 118 119 * xmlSchemaValidityWarningFunc: 120 * @ctx: the validation context 121 * @msg: the message 122 * @...: extra arguments 123 * 124 * Signature of a warning callback from an XSD validation 125 126 d xmlSchemaValidityWarningFunc... 127 d s * based(######typedef######) 128 d procptr 129 130 * A schemas validation context 131 132 d xmlSchemaParserCtxtPtr... 133 d s * based(######typedef######) 134 135 d xmlSchemaValidCtxtPtr... 136 d s * based(######typedef######) 137 138 * xmlSchemaValidityLocatorFunc: 139 * @ctx: user provided context 140 * @file: returned file information 141 * @line: returned line information 142 * 143 * A schemas validation locator, a callback called by the validator. 144 * This is used when file or node informations are not available 145 * to find out what file and line number are affected 146 * 147 * Returns: 0 in case of success and -1 in case of error 148 149 d xmlSchemaValidityLocatorFunc... 150 d s * based(######typedef######) 151 d procptr 152 153 * Interfaces for parsing. 154 155 d xmlSchemaNewParserCtxt... 156 d pr extproc('xmlSchemaNewParserCtxt') 157 d like(xmlSchemaParserCtxtPtr) 158 d URL * value options(*string) const char * 159 160 d xmlSchemaNewMemParserCtxt... 161 d pr extproc('xmlSchemaNewMemParserCtxt') 162 d like(xmlSchemaParserCtxtPtr) 163 d buffer * value options(*string) const char * 164 d size value like(xmlCint) 165 166 d xmlSchemaNewDocParserCtxt... 167 d pr extproc('xmlSchemaNewDocParserCtxt') 168 d like(xmlSchemaParserCtxtPtr) 169 d doc value like(xmlDocPtr) 170 171 d xmlSchemaFreeParserCtxt... 172 d pr extproc('xmlSchemaFreeParserCtxt') 173 d ctxt value like(xmlSchemaParserCtxtPtr) 174 175 d xmlSchemaSetParserErrors... 176 d pr extproc('xmlSchemaSetParserErrors') 177 d ctxt value like(xmlSchemaParserCtxtPtr) 178 d err value 179 d like(xmlSchemaValidityErrorFunc) 180 d warn value 181 d like(xmlSchemaValidityWarningFunc) 182 d ctx * value void * 183 184 d xmlSchemaSetParserStructuredErrors... 185 d pr extproc( 186 d 'xmlSchemaSetParserStructuredErrors') 187 d ctxt value like(xmlSchemaParserCtxtPtr) 188 d serror value like(xmlStructuredErrorFunc) 189 d ctx * value void * 190 191 d xmlSchemaGetParserErrors... 192 d pr extproc('xmlSchemaGetParserErrors') 193 d like(xmlCint) 194 d ctxt value like(xmlSchemaParserCtxtPtr) 195 d err like(xmlSchemaValidityErrorFunc) 196 d warn like(xmlSchemaValidityWarningFunc) 197 d ctx * void *(*) 198 199 d xmlSchemaIsValid... 200 d pr extproc('xmlSchemaIsValid') 201 d like(xmlCint) 202 d ctxt value like(xmlSchemaValidCtxtPtr) 203 204 d xmlSchemaParse pr extproc('xmlSchemaParse') 205 d like(xmlSchemaPtr) 206 d ctxt value like(xmlSchemaParserCtxtPtr) 207 208 d xmlSchemaFree pr extproc('xmlSchemaFree') 209 d schema value like(xmlSchemaPtr) 210 211 /if defined(LIBXML_OUTPUT_ENABLED) 212 d xmlSchemaDump pr extproc('xmlSchemaDump') 213 d output * value FILE * 214 d schema value like(xmlSchemaPtr) 215 /endif LIBXML_OUTPUT_ENABLD 216 217 * Interfaces for validating 218 219 d xmlSchemaSetValidErrors... 220 d pr extproc('xmlSchemaSetValidErrors') 221 d ctxt value like(xmlSchemaValidCtxtPtr) 222 d err value 223 d like(xmlSchemaValidityErrorFunc) 224 d warn value 225 d like(xmlSchemaValidityWarningFunc) 226 d ctx * value void * 227 228 d xmlSchemaSetValidStructuredErrors... 229 d pr extproc( 230 d 'xmlSchemaSetValidStructuredErrors') 231 d ctxt value like(xmlSchemaValidCtxtPtr) 232 d serror value like(xmlStructuredErrorFunc) 233 d ctx * value void * 234 235 d xmlSchemaGetValidErrors... 236 d pr extproc('xmlSchemaGetValidErrors') 237 d like(xmlCint) 238 d ctxt value like(xmlSchemaValidCtxtPtr) 239 d err like(xmlSchemaValidityErrorFunc) 240 d warn like(xmlSchemaValidityWarningFunc) 241 d ctx * void *(*) 242 243 d xmlSchemaSetValidOptions... 244 d pr extproc('xmlSchemaSetValidOptions') 245 d like(xmlCint) 246 d ctxt value like(xmlSchemaValidCtxtPtr) 247 d options value like(xmlCint) 248 249 d xmlSchemaValidateSetFilename... 250 d pr extproc( 251 d 'xmlSchemaValidateSetFilename') 252 d vctxt value like(xmlSchemaValidCtxtPtr) 253 d filename * value options(*string) const char * 254 255 d xmlSchemaValidCtxtGetOptions... 256 d pr extproc( 257 d 'xmlSchemaValidCtxtGetOptions') 258 d like(xmlCint) 259 d ctxt value like(xmlSchemaValidCtxtPtr) 260 261 d xmlSchemaNewValidCtxt... 262 d pr extproc('xmlSchemaNewValidCtxt') 263 d like(xmlSchemaValidCtxtPtr) 264 d schema value like(xmlSchemaPtr) 265 266 d xmlSchemaFreeValidCtxt... 267 d pr extproc('xmlSchemaFreeValidCtxt') 268 d ctxt value like(xmlSchemaValidCtxtPtr) 269 270 d xmlSchemaValidateDoc... 271 d pr extproc('xmlSchemaValidateDoc') 272 d like(xmlCint) 273 d ctxt value like(xmlSchemaValidCtxtPtr) 274 d instance value like(xmlDocPtr) 275 276 d xmlSchemaValidateOneElement... 277 d pr extproc( 278 d 'xmlSchemaValidateOneElement') 279 d like(xmlCint) 280 d ctxt value like(xmlSchemaValidCtxtPtr) 281 d elem value like(xmlNodePtr) 282 283 d xmlSchemaValidateStream... 284 d pr extproc('xmlSchemaValidateStream') 285 d like(xmlCint) 286 d ctxt value like(xmlSchemaValidCtxtPtr) 287 d input value like(xmlParserInputBufferPtr) 288 d enc value like(xmlCharEncoding) 289 d sax value like(xmlSAXHandlerPtr) 290 d user_data * value void * 291 292 d xmlSchemaValidateFile... 293 d pr extproc('xmlSchemaValidateFile') 294 d like(xmlCint) 295 d ctxt value like(xmlSchemaValidCtxtPtr) 296 d filename * value options(*string) const char * 297 d options value like(xmlCint) 298 299 d xmlSchemaValidCtxtGetParserCtxt... 300 d pr extproc( 301 d 'xmlSchemaValidCtxtGetParserCtxt') 302 d like(xmlParserCtxtPtr) 303 d ctxt value like(xmlSchemaValidCtxtPtr) 304 305 * Interface to insert Schemas SAX validation in a SAX stream 306 307 d xmlSchemaSAXPlugPtr... 308 d s * based(######typedef######) 309 310 d xmlSchemaSAXPlug... 311 d pr extproc('xmlSchemaSAXPlug') 312 d like(xmlSchemaSAXPlugPtr) 313 d ctxt value like(xmlSchemaValidCtxtPtr) 314 d sax like(xmlSAXHandlerPtr) 315 d user_data * void *(*) 316 317 d xmlSchemaSAXUnplug... 318 d pr extproc('xmlSchemaSAXUnplug') 319 d like(xmlCint) 320 d plug value like(xmlSchemaSAXPlugPtr) 321 322 d xmlSchemaValidateSetLocator... 323 d pr extproc( 324 d 'xmlSchemaValidateSetLocator') 325 d vctxt value like(xmlSchemaValidCtxtPtr) 326 d f value 327 d like(xmlSchemaValidityLocatorFunc) 328 d ctxt * value void * 329 330 /endif LIBXML_SCHEMAS_ENBLD 331 /endif XML_SCHEMA_H__ 332