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