schematron.inc 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. (*
  2. * Summary: XML Schemastron implementation
  3. * Description: interface to the XML Schematron validity checking.
  4. *
  5. * Copy: See Copyright for the status of this software.
  6. *
  7. * Author: Daniel Veillard
  8. *)
  9. {$IFDEF LIBXML_SCHEMATRON_ENABLED}
  10. {$IFDEF CONST}
  11. XML_SCHEMATRON_OUT_QUIET = 1 shl 0; (* quiet no report *)
  12. XML_SCHEMATRON_OUT_TEXT = 1 shl 1; (* build a textual report *)
  13. XML_SCHEMATRON_OUT_XML = 1 shl 2; (* output SVRL *)
  14. XML_SCHEMATRON_OUT_ERROR = 1 shl 3; (* output via xmlStructuredErrorFunc *)
  15. XML_SCHEMATRON_OUT_FILE = 1 shl 8; (* output to a file descriptor *)
  16. XML_SCHEMATRON_OUT_BUFFER = 1 shl 9; (* output to a buffer *)
  17. XML_SCHEMATRON_OUT_IO = 1 shl 10; (* output to I/O mechanism *)
  18. {$ENDIF}
  19. {$IFDEF POINTER}
  20. xmlSchematronPtr = ^xmlSchematron;
  21. xmlSchematronParserCtxtPtr = ^xmlSchematronParserCtxt;
  22. xmlSchematronValidCtxtPtr = ^xmlSchematronValidCtxt;
  23. {$ENDIF}
  24. {$IFDEF TYPE}
  25. xmlSchematronValidOptions = type cint;
  26. (**
  27. * The schemas related types are kept internal
  28. *)
  29. xmlSchematron = record end;
  30. (**
  31. * A schemas validation context
  32. *)
  33. xmlSchematronValidityErrorFunc = procedure(ctx: pointer; msg: pchar); cdecl; varargs;
  34. xmlSchematronValidityWarningFunc = procedure(ctx: pointer; msg: pchar); cdecl; varargs;
  35. xmlSchematronParserCtxt = record end;
  36. xmlSchematronValidCtxt = record end;
  37. {$ENDIF}
  38. {$IFDEF FUNCTION}
  39. (*
  40. * Interfaces for parsing.
  41. *)
  42. function xmlSchematronNewParserCtxt(URL: pchar): xmlSchematronParserCtxtPtr; EXTDECL; external xml2lib;
  43. function xmlSchematronNewMemParserCtxt(buffer: pchar; size: cint): xmlSchematronParserCtxtPtr; EXTDECL; external xml2lib;
  44. function xmlSchematronNewDocParserCtxt(doc: xmlDocPtr): xmlSchematronParserCtxtPtr; EXTDECL; external xml2lib;
  45. procedure xmlSchematronFreeParserCtxt(ctxt: xmlSchematronParserCtxtPtr); EXTDECL; external xml2lib;
  46. (*****
  47. external xml2lib void EXTDECL
  48. xmlSchematronSetParserErrors(xmlSchematronParserCtxtPtr ctxt,
  49. xmlSchematronValidityErrorFunc err,
  50. xmlSchematronValidityWarningFunc warn,
  51. void *ctx);
  52. external xml2lib int EXTDECL
  53. xmlSchematronGetParserErrors(xmlSchematronParserCtxtPtr ctxt,
  54. xmlSchematronValidityErrorFunc * err,
  55. xmlSchematronValidityWarningFunc * warn,
  56. void **ctx);
  57. external xml2lib int EXTDECL
  58. xmlSchematronIsValid (xmlSchematronValidCtxtPtr ctxt);
  59. *****)
  60. function xmlSchematronParse(ctxt: xmlSchematronParserCtxtPtr): xmlSchematronPtr; EXTDECL; external xml2lib;
  61. procedure xmlSchematronFree(schema: xmlSchematronPtr); EXTDECL; external xml2lib;
  62. (*
  63. * Interfaces for validating
  64. *)
  65. procedure xmlSchematronSetValidStructuredErrors(ctxt: xmlSchematronValidCtxtPtr; serror: xmlStructuredErrorFunc; ctx: pointer); EXTDECL; external xml2lib;
  66. (******
  67. external xml2lib void EXTDECL
  68. xmlSchematronSetValidErrors (xmlSchematronValidCtxtPtr ctxt,
  69. xmlSchematronValidityErrorFunc err,
  70. xmlSchematronValidityWarningFunc warn,
  71. void *ctx);
  72. external xml2lib int EXTDECL
  73. xmlSchematronGetValidErrors (xmlSchematronValidCtxtPtr ctxt,
  74. xmlSchematronValidityErrorFunc *err,
  75. xmlSchematronValidityWarningFunc *warn,
  76. void **ctx);
  77. external xml2lib int EXTDECL
  78. xmlSchematronSetValidOptions(xmlSchematronValidCtxtPtr ctxt,
  79. int options);
  80. external xml2lib int EXTDECL
  81. xmlSchematronValidCtxtGetOptions(xmlSchematronValidCtxtPtr ctxt);
  82. external xml2lib int EXTDECL
  83. xmlSchematronValidateOneElement (xmlSchematronValidCtxtPtr ctxt,
  84. xmlNodePtr elem);
  85. *******)
  86. function xmlSchematronNewValidCtxt(schema: xmlSchematronPtr; options: cint): xmlSchematronValidCtxtPtr; EXTDECL; external xml2lib;
  87. procedure xmlSchematronFreeValidCtxt(ctxt: xmlSchematronValidCtxtPtr); EXTDECL; external xml2lib;
  88. function xmlSchematronValidateDoc(ctxt: xmlSchematronValidCtxtPtr; instance: xmlDocPtr): cint; EXTDECL; external xml2lib;
  89. {$ENDIF}
  90. {$ENDIF} (* LIBXML_SCHEMATRON_ENABLED *)