1 * Summary: The DTD validation
2 * Description: API for the DTD handling and the validity checking
4 * Copy: See Copyright for the status of this software.
6 * Author: Patrick Monnerat <pm@datasphere.ch>, DATASPHERE S.A.
8 /if not defined(XML_VALID_H__)
11 /include "libxmlrpg/xmlversion"
12 /include "libxmlrpg/xmlerror"
13 /include "libxmlrpg/tree"
14 /include "libxmlrpg/list"
15 /include "libxmlrpg/xmlautomata"
16 /include "libxmlrpg/xmlregexp"
18 * Validation state added for non-determinist content model.
21 d s * based(######typedef######)
23 * xmlValidityErrorFunc:
24 * @ctx: usually an xmlValidCtxtPtr to a validity error context,
25 * but comes from ctxt->userData (which normally contains such
26 * a pointer); ctxt->userData can be changed by the user.
27 * @msg: the string to format *printf like vararg
28 * @...: remaining arguments to the format
30 * Callback called when a validity error is found. This is a message
31 * oriented function similar to an *printf function.
33 d xmlValidityErrorFunc...
34 d s * based(######typedef######)
37 * xmlValidityWarningFunc:
38 * @ctx: usually an xmlValidCtxtPtr to a validity error context,
39 * but comes from ctxt->userData (which normally contains such
40 * a pointer); ctxt->userData can be changed by the user.
41 * @msg: the string to format *printf like vararg
42 * @...: remaining arguments to the format
44 * Callback called when a validity warning is found. This is a message
45 * oriented function similar to an *printf function.
47 d xmlValidityWarningFunc...
48 d s * based(######typedef######)
52 * An xmlValidCtxt is used for error reporting when validating.
55 d s * based(######typedef######)
57 d xmlValidCtxt ds based(xmlValidCtxtPtr)
60 d error like(xmlValidityErrorFunc) Error callback
61 d warning like(xmlValidityWarningFunc) Warning callback
63 * Node analysis stack used when validating within entities
65 d node like(xmlNodePtr) Current parsed Node
66 d nodeNr 10i 0 Parsing stack depth
67 d nodeMax 10i 0 Max stack depth
68 d nodeTab * xmlNodePtr *
70 d finishDtd 10u 0 Finish validtng DTD?
71 d doc like(xmlDocPtr) The document
72 d valid 10i 0 Temp check result
74 * state state used for non-determinist content validation
76 d vstate * xmlValidState *
77 d vstateNr 10i 0 Validat. stack depth
78 d vstateMax 10i 0 Max stack depth
79 d vstateTab * xmlValidState *
81 /if defined(LIBXML_REGEXP_ENABLED)
82 d am like(xmlAutomataPtr) The automata
83 d state like(xmlAutomataStatePtr) Automata build state
89 * ALL notation declarations are stored in a table.
90 * There is one table per DTD.
92 d xmlNotationTablePtr...
93 d s * based(######typedef######)
95 * ALL element declarations are stored in a table.
96 * There is one table per DTD.
98 d xmlElementTablePtr...
99 d s * based(######typedef######)
101 * ALL attribute declarations are stored in a table.
102 * There is one table per DTD.
104 d xmlAttributeTablePtr...
105 d s * based(######typedef######)
107 * ALL IDs attributes are stored in a table.
108 * There is one table per document.
110 d xmlIDTablePtr s * based(######typedef######)
112 * ALL Refs attributes are stored in a table.
113 * There is one table per document.
115 d xmlRefTablePtr s * based(######typedef######)
119 d xmlAddNotationDecl...
120 d pr extproc('xmlAddNotationDecl')
121 d like(xmlNotationPtr)
122 d ctxt value like(xmlValidCtxtPtr)
123 d dtd value like(xmlDtdPtr)
124 d name * value options(*string) const xmlChar *
125 d PublicID * value options(*string) const xmlChar *
126 d SystemID * value options(*string) const xmlChar *
128 /if defined(LIBXML_TREE_ENABLED)
129 d xmlCopyNotationTable...
130 d pr extproc('xmlCopyNotationTable')
131 d like(xmlNotationPtr)
132 d table value like(xmlNotationTablePtr)
133 /endif LIBXML_TREE_ENABLED
135 d xmlFreeNotationTable...
136 d pr extproc('xmlFreeNotationTable')
137 d table value like(xmlNotationTablePtr)
139 /if defined(LIBXML_OUTPUT_ENABLED)
140 d xmlDumpNotationDecl...
141 d pr extproc('xmlDumpNotationDecl')
142 d buf value like(xmlBufferPtr)
143 d nota value like(xmlNotationPtr)
145 d xmlDumpNotationTable...
146 d pr extproc('xmlDumpNotationTable')
147 d buf value like(xmlBufferPtr)
148 d table value like(xmlNotationTablePtr)
149 /endif LIBXML_OUTPUT_ENABLD
152 * the non Doc version are being deprecated
154 d xmlNewElementContent...
155 d pr extproc('xmlNewElementContent')
156 d like(xmlElementContentPtr)
157 d name * value const xmlChar *
158 d type value like(xmlElementContentType)
160 d xmlCopyElementContent...
161 d pr extproc('xmlCopyElementContent')
162 d like(xmlElementContentPtr)
163 d content value like(xmlElementContentPtr)
165 d xmlFreeElementContent...
166 d pr extproc('xmlFreeElementContent')
167 d cur value like(xmlElementContentPtr)
169 * the new versions with doc argument
171 d xmlNewDocElementContent...
172 d pr extproc('xmlNewDocElementContent')
173 d like(xmlElementContentPtr)
174 d doc value like(xmlDocPtr)
175 d name * value const xmlChar *
176 d type value like(xmlElementContentType)
178 d xmlCopyDocElementContent...
179 d pr extproc('xmlCopyDocElementContent')
180 d like(xmlElementContentPtr)
181 d doc value like(xmlDocPtr)
182 d content value like(xmlElementContentPtr)
184 d xmlFreeDocElementContent...
185 d pr extproc('xmlFreeDocElementContent')
186 d doc value like(xmlDocPtr)
187 d cur value like(xmlElementContentPtr)
189 d xmlSnprintfElementContent...
190 d pr extproc('xmlSnprintfElementContent')
191 d buf 65535 options(*varsize)
193 d content value like(xmlElementContentPtr)
196 /if defined(LIBXML_OUTPUT_ENABLED)
198 d xmlSprintfElementContent...
199 d pr extproc('xmlSprintfElementContent')
200 d buf 65535 options(*varsize)
201 d content value like(xmlElementContentPtr)
203 /endif LIBXML_OUTPUT_ENABLD
209 d xmlAddElementDecl...
210 d pr extproc('xmlAddElementDecl')
211 d like(xmlElementPtr)
212 d ctxt value like(xmlValidCtxtPtr)
213 d dtd value like(xmlDtdPtr)
214 d name * value options(*string) const xmlChar *
215 d type value like(xmlElementTypeVal)
216 d content value like(xmlElementContentPtr)
218 /if defined(LIBXML_TREE_ENABLED)
219 d xmlCopyElementTable...
220 d pr extproc('xmlCopyElementTable')
221 d like(xmlElementTablePtr)
222 d table value like(xmlElementTablePtr)
223 /endif LIBXML_TREE_ENABLED
225 d xmlFreeElementTable...
226 d pr extproc('xmlFreeElementTable')
227 d table value like(xmlElementTablePtr)
229 /if defined(LIBXML_OUTPUT_ENABLED)
230 d xmlDumpElementTable...
231 d pr extproc('xmlDumpElementTable')
232 d buf value like(xmlBufferPtr)
233 d table value like(xmlElementTablePtr)
235 d xmlDumpElementDecl...
236 d pr extproc('xmlDumpElementDecl')
237 d buf value like(xmlBufferPtr)
238 d elem value like(xmlElementPtr)
239 /endif LIBXML_OUTPUT_ENABLD
243 d xmlCreateEnumeration...
244 d pr extproc('xmlCreateEnumeration')
245 d like(xmlEnumerationPtr)
246 d name * value options(*string) const xmlChar *
248 d xmlFreeEnumeration...
249 d pr extproc('xmlFreeEnumeration')
250 d cur value like(xmlEnumerationPtr)
252 /if defined(LIBXML_TREE_ENABLED)
253 d xmlCopyEnumeration...
254 d pr extproc('xmlCopyEnumeration')
255 d like(xmlEnumerationPtr)
256 d cur value like(xmlEnumerationPtr)
257 /endif LIBXML_TREE_ENABLED
261 d xmlAddAttributeDecl...
262 d pr extproc('xmlAddAttributeDecl')
263 d like(xmlAttributePtr)
264 d ctxt value like(xmlValidCtxtPtr)
265 d dtd value like(xmlDtdPtr)
266 d elem * value options(*string) const xmlChar *
267 d name * value options(*string) const xmlChar *
268 d ns * value options(*string) const xmlChar *
269 d type value like(xmlAttributeType)
270 d def value like(xmlAttributeDefault)
271 d defaultValue * value options(*string) const xmlChar *
272 d tree value like(xmlEnumerationPtr)
274 /if defined(LIBXML_TREE_ENABLED)
275 d xmlCopyAttributeTable...
276 d pr extproc('xmlCopyAttributeTable')
277 d like(xmlAttributeTablePtr)
278 d table value like(xmlAttributeTablePtr)
279 /endif LIBXML_TREE_ENABLED
281 d xmlFreeAttributeTable...
282 d pr extproc('xmlFreeAttributeTable')
283 d table value like(xmlAttributeTablePtr)
285 /if defined(LIBXML_OUTPUT_ENABLED)
286 d xmlDumpAttributeTable...
287 d pr extproc('xmlDumpAttributeTable')
288 d buf value like(xmlBufferPtr)
289 d table value like(xmlAttributeTablePtr)
291 d xmlDumpAttributeDecl...
292 d pr extproc('xmlDumpAttributeDecl')
293 d buf value like(xmlBufferPtr)
294 d attr value like(xmlAttributePtr)
295 /endif LIBXML_OUTPUT_ENABLD
299 d xmlAddID pr extproc('xmlAddID')
301 d ctxt value like(xmlValidCtxtPtr)
302 d doc value like(xmlDocPtr)
303 d value * value options(*string) const xmlChar *
304 d attr value like(xmlAttrPtr)
306 d xmlFreeIdTable pr extproc('xmlFreeIDTable')
307 d table value like(xmlIDTablePtr)
309 d xmlGetID pr extproc('xmlGetID')
311 d doc value like(xmlDocPtr)
312 d ID * value options(*string) const xmlChar *
314 d xmlIsID pr 10i 0 extproc('xmlIsID')
315 d doc value like(xmlDocPtr)
316 d node value like(xmlNodePtr)
317 d attr value like(xmlAttrPtr)
319 d xmlRemoveID pr 10i 0 extproc('xmlRemoveID')
320 d doc value like(xmlDocPtr)
321 d attr value like(xmlAttrPtr)
325 d xmlAddRef pr extproc('xmlAddRef')
327 d ctxt value like(xmlValidCtxtPtr)
328 d doc value like(xmlDocPtr)
329 d value * value options(*string) const xmlChar *
330 d attr value like(xmlAttrPtr)
333 d pr extproc('xmlFreeRefTable')
334 d table value like(xmlRefTablePtr)
336 d xmlIsRef pr 10i 0 extproc('xmlIsRef')
337 d doc value like(xmlDocPtr)
338 d node value like(xmlNodePtr)
339 d attr value like(xmlAttrPtr)
341 d xmlRemoveRef pr 10i 0 extproc('xmlRemoveRef')
342 d doc value like(xmlDocPtr)
343 d attr value like(xmlAttrPtr)
345 d xmlGetRefs pr extproc('xmlGetRefs')
347 d doc value like(xmlDocPtr)
348 d ID * value options(*string) const xmlChar *
350 * The public function calls related to validity checking.
352 /if defined(LIBXML_VALID_ENABLED)
353 * Allocate/Release Validation Contexts
356 d pr extproc('xmlNewValidCtxt')
357 d like(xmlValidCtxtPtr)
359 d xmlFreeValidCtxt...
360 d pr extproc('xmlFreeValidCtxt')
361 d ctxt value like(xmlValidCtxtPtr)
364 d pr 10i 0 extproc('xmlValidateRoot')
365 d ctxt value like(xmlValidCtxtPtr)
366 d doc value like(xmlDocPtr)
368 d xmlValidateElementDecl...
369 d pr 10i 0 extproc('xmlValidateElementDecl')
370 d ctxt value like(xmlValidCtxtPtr)
371 d doc value like(xmlDocPtr)
372 d elem value like(xmlElementPtr)
374 d xmlValidNormalizeAttributeValue...
375 d pr * extproc( xmlChar *
376 d 'xmlValidNormalizeAttributeValue')
377 d doc value like(xmlDocPtr)
378 d elem value like(xmlNodePtr)
379 d name * value options(*string) const xmlChar *
380 d value * value options(*string) const xmlChar *
382 d xmlValidCtxtNormalizeAttributeValue...
383 d pr * extproc('xmlValidCtxt+ xmlChar *
384 d NormalizeAttributeValue')
385 d ctxt value like(xmlValidCtxtPtr)
386 d doc value like(xmlDocPtr)
387 d elem value like(xmlNodePtr)
388 d name * value options(*string) const xmlChar *
389 d value * value options(*string) const xmlChar *
391 d xmlValidateAttributeDecl...
392 d pr 10i 0 extproc('xmlValidateAttributeDecl')
393 d ctxt value like(xmlValidCtxtPtr)
394 d doc value like(xmlDocPtr)
395 d attr value like(xmlAttributePtr)
397 d xmlValidateAttributeValue...
398 d pr 10i 0 extproc('xmlValidateAttributeValue')
399 d type value like(xmlAttributeType)
400 d value * value options(*string) const xmlChar *
402 d xmlValidateNotationDecl...
403 d pr 10i 0 extproc('xmlValidateNotationDecl')
404 d ctxt value like(xmlValidCtxtPtr)
405 d doc value like(xmlDocPtr)
406 d nota value like(xmlNotationPtr)
408 d xmlValidateDtd pr 10i 0 extproc('xmlValidateDtd')
409 d ctxt value like(xmlValidCtxtPtr)
410 d doc value like(xmlDocPtr)
411 d dtd value like(xmlDtdPtr)
413 d xmlValidateDtdFinal...
414 d pr 10i 0 extproc('xmlValidateDtdFinal')
415 d ctxt value like(xmlValidCtxtPtr)
416 d doc value like(xmlDocPtr)
418 d xmlValidateDocument...
419 d pr 10i 0 extproc('xmlValidateDocument')
420 d ctxt value like(xmlValidCtxtPtr)
421 d doc value like(xmlDocPtr)
423 d xmlValidateElement...
424 d pr 10i 0 extproc('xmlValidateElement')
425 d ctxt value like(xmlValidCtxtPtr)
426 d doc value like(xmlDocPtr)
427 d elem value like(xmlNodePtr)
429 d xmlValidateOneElement...
430 d pr 10i 0 extproc('xmlValidateOneElement')
431 d ctxt value like(xmlValidCtxtPtr)
432 d doc value like(xmlDocPtr)
433 d elem value like(xmlNodePtr)
435 d xmlValidateOneAttribute...
436 d pr 10i 0 extproc('xmlValidateOneAttribute')
437 d ctxt value like(xmlValidCtxtPtr)
438 d doc value like(xmlDocPtr)
439 d elem value like(xmlNodePtr)
440 d attr value like(xmlAttrPtr)
441 d value * value options(*string) const xmlChar *
443 d xmlValidateOneNamespace...
444 d pr 10i 0 extproc('xmlValidateOneNamespace')
445 d ctxt value like(xmlValidCtxtPtr)
446 d doc value like(xmlDocPtr)
447 d elem value like(xmlNodePtr)
448 d prefix * value options(*string) const xmlChar *
449 d ns value like(xmlNsPtr)
450 d value * value options(*string) const xmlChar *
452 d xmlValidateDocumentFinal...
453 d pr 10i 0 extproc('xmlValidateDocumentFinal')
454 d ctxt value like(xmlValidCtxtPtr)
455 d doc value like(xmlDocPtr)
456 /endif LIBXML_VALID_ENABLED
458 /undefine XML_TESTVAL
459 /if defined(LIBXML_VALID_ENABLED)
461 /elseif defined(LIBXML_SCHEMAS_ENABLED)
464 /if defined(XML_TESTVAL)
465 d xmlValidateNotationUse...
466 d pr 10i 0 extproc('xmlValidateNotationUse')
467 d ctxt value like(xmlValidCtxtPtr)
468 d doc value like(xmlDocPtr)
469 d notationName * value options(*string) const xmlChar *
471 /undefine XML_TESTVAL
474 d xmlIsMixedElement...
475 d pr 10i 0 extproc('xmlIsMixedElement')
476 d doc value like(xmlDocPtr)
477 d name * value options(*string) const xmlChar *
479 d xmlGetDtdAttrDesc...
480 d pr extproc('xmlGetDtdAttrDesc')
481 d like(xmlAttributePtr)
482 d dtd value like(xmlDtdPtr)
483 d elem * value options(*string) const xmlChar *
484 d name * value options(*string) const xmlChar *
486 d xmlGetDtdQAttrDesc...
487 d pr extproc('xmlGetDtdQAttrDesc')
488 d like(xmlAttributePtr)
489 d dtd value like(xmlDtdPtr)
490 d elem * value options(*string) const xmlChar *
491 d name * value options(*string) const xmlChar *
492 d prefix * value options(*string) const xmlChar *
494 d xmlGetDtdNotationDesc...
495 d pr extproc('xmlGetDtdNotationDesc')
496 d like(xmlNotationPtr)
497 d dtd value like(xmlDtdPtr)
498 d name * value options(*string) const xmlChar *
500 d xmlGetDtdQElementDesc...
501 d pr extproc('xmlGetDtdQElementDesc')
502 d like(xmlElementPtr)
503 d dtd value like(xmlDtdPtr)
504 d name * value options(*string) const xmlChar *
505 d prefix * value options(*string) const xmlChar *
507 d xmlGetDtdElementDesc...
508 d pr extproc('xmlGetDtdElementDesc')
509 d like(xmlElementPtr)
510 d dtd value like(xmlDtdPtr)
511 d name * value options(*string) const xmlChar *
513 /if defined(LIBXML_VALID_ENABLED)
514 d xmlValidGetPotentialChildren...
516 d 'xmlValidGetPotentialChildren')
517 d ctree * value xmlElementContent *
518 d names * const xmlChar *(*)
522 d xmlValidGetValidElements...
523 d pr 10i 0 extproc('xmlValidGetValidElements')
524 d prev like(xmlNodePtr)
525 d next like(xmlNodePtr)
526 d names * const xmlChar *(*)
529 d xmlValidateNameValue...
530 d pr 10i 0 extproc('xmlValidateNameValue')
531 d value * value options(*string) const xmlChar *
533 d xmlValidateNamesValue...
534 d pr 10i 0 extproc('xmlValidateNamesValue')
535 d value * value options(*string) const xmlChar *
537 d xmlValidateNmtokenValue...
538 d pr 10i 0 extproc('xmlValidateNmtokenValue')
539 d value * value options(*string) const xmlChar *
541 d xmlValidateNmtokensValue...
542 d pr 10i 0 extproc('xmlValidateNmtokensValue')
543 d value * value options(*string) const xmlChar *
545 /if defined(LIBXML_REGEXP_ENABLED)
546 * Validation based on the regexp support
548 d xmlValidBuildContentModel...
549 d pr 10i 0 extproc('xmlValidBuildContentModel')
550 d ctxt value like(xmlValidCtxtPtr)
551 d elem value like(xmlElementPtr)
553 d xmlValidatePushElement...
554 d pr 10i 0 extproc('xmlValidatePushElement')
555 d ctxt value like(xmlValidCtxtPtr)
556 d doc value like(xmlDocPtr)
557 d elem value like(xmlNodePtr)
558 d qname * value options(*string) const xmlChar *
560 d xmlValidatePushCData...
561 d pr 10i 0 extproc('xmlValidatePushCData')
562 d ctxt value like(xmlValidCtxtPtr)
563 d data * value options(*string) const xmlChar *
566 d xmlValidatePopElement...
567 d pr 10i 0 extproc('xmlValidatePopElement')
568 d ctxt value like(xmlValidCtxtPtr)
569 d doc value like(xmlDocPtr)
570 d elem value like(xmlNodePtr)
571 d qname * value options(*string) const xmlChar *
573 /endif LIBXML_REGEXP_ENABLD
574 /endif LIBXML_VALID_ENABLED