1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
|
(*
* Summary: The DTD validation
* Description: API for the DTD handling and the validity checking
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*)
{$IFDEF POINTER}
xmlValidStatePtr = ^xmlValidState;
xmlValidCtxtPtr = ^xmlValidCtxt;
xmlNotationTablePtr = ^xmlNotationTable;
xmlElementTablePtr = ^xmlElementTable;
xmlAttributeTablePtr = ^xmlAttributeTable;
xmlIDTablePtr = ^xmlIDTable;
xmlRefTablePtr = ^xmlRefTable;
{$ENDIF}
{$IFDEF TYPE}
(*
* Validation state added for non-determinist content model.
*)
xmlValidState = record end;
(**
* xmlValidityErrorFunc:
* @ctx: usually an xmlValidCtxtPtr to a validity error context,
* but comes from ctxt->userData (which normally contains such
* a pointer); ctxt->userData can be changed by the user.
* @msg: the string to format *printf like vararg
* @...: remaining arguments to the format
*
* Callback called when a validity error is found. This is a message
* oriented function similar to an *printf function.
*)
xmlValidityErrorFunc = procedure(ctx: pointer; msg: pchar); cdecl; varargs;
(**
* xmlValidityWarningFunc:
* @ctx: usually an xmlValidCtxtPtr to a validity error context,
* but comes from ctxt->userData (which normally contains such
* a pointer); ctxt->userData can be changed by the user.
* @msg: the string to format *printf like vararg
* @...: remaining arguments to the format
*
* Callback called when a validity warning is found. This is a message
* oriented function similar to an *printf function.
*)
xmlValidityWarningFunc = procedure(ctx: pointer; msg: pchar); cdecl; varargs;
(*
* xmlValidCtxt:
* An xmlValidCtxt is used for error reporting when validating.
*)
xmlValidCtxt = record
userData : pointer; (* user specific data block *)
error : xmlValidityErrorFunc; (* the callback in case of errors *)
warning : xmlValidityWarningFunc; (* the callback in case of warning *)
(* Node analysis stack used when validating within entities *)
node : xmlNodePtr; (* Current parsed Node *)
nodeNr : cint; (* Depth of the parsing stack *)
nodeMax : cint; (* Max depth of the parsing stack *)
nodeTab : xmlNodePtrPtr; (* array of nodes *)
finishDtd : cuint; (* finished validating the Dtd ? *)
doc : xmlDocPtr; (* the document *)
valid : cint; (* temporary validity check result *)
(* state state used for non-determinist content validation *)
vstate : xmlValidStatePtr; (* current state *)
vstateNr : cint; (* Depth of the validation stack *)
vstateMax : cint; (* Max depth of the validation stack *)
vstateTab : xmlValidStatePtr; (* array of validation states *)
{$IFDEF LIBXML_REGEXP_ENABLED}
am : xmlAutomataPtr; (* the automata *)
state : xmlAutomataStatePtr; (* used to build the automata *)
{$ELSE}
am : pointer;
state : pointer;
{$ENDIF}
end;
(*
* ALL notation declarations are stored in a table.
* There is one table per DTD.
*)
xmlNotationTable = type xmlHashTable;
(*
* ALL element declarations are stored in a table.
* There is one table per DTD.
*)
xmlElementTable = type xmlHashTable;
(*
* ALL attribute declarations are stored in a table.
* There is one table per DTD.
*)
xmlAttributeTable = type xmlHashTable;
(*
* ALL IDs attributes are stored in a table.
* There is one table per document.
*)
xmlIDTable = type xmlHashTable;
(*
* ALL Refs attributes are stored in a table.
* There is one table per document.
*)
xmlRefTable = type xmlHashTable;
{$ENDIF}
{$IFDEF FUNCTION}
(* Notation *)
function xmlAddNotationDecl(ctxt: xmlValidCtxtPtr; dtd: xmlDtdPtr; name, PublicID, SystemID: xmlCharPtr): xmlNotationPtr; EXTDECL; external xml2lib;
{$IFDEF LIBXML_TREE_ENABLED}
function xmlCopyNotationTable(table: xmlNotationTablePtr): xmlNotationTablePtr; EXTDECL; external xml2lib;
{$ENDIF} (* LIBXML_TREE_ENABLED *)
procedure xmlFreeNotationTable(table: xmlNotationTablePtr); EXTDECL; external xml2lib;
{$IFDEF LIBXML_OUTPUT_ENABLED}
procedure xmlDumpNotationDecl(buf: xmlBufferPtr; nota: xmlNotationPtr); EXTDECL; external xml2lib;
procedure xmlDumpNotationTable(buf: xmlBufferPtr; table: xmlNotationTablePtr); EXTDECL; external xml2lib;
{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
(* Element Content *)
function xmlNewDocElementContent(doc: xmlDocPtr; name: xmlCharPtr; _type: xmlElementContentType): xmlElementContentPtr; EXTDECL; external xml2lib;
function xmlCopyDocElementContent(doc: xmlDocPtr; content: xmlElementContentPtr): xmlElementContentPtr; EXTDECL; external xml2lib;
procedure xmlFreeDocElementContent(doc: xmlDocPtr; cur: xmlElementContentPtr); EXTDECL; external xml2lib;
procedure xmlSnprintfElementContent(buf: pchar; size: cint; content: xmlElementContentPtr; englob: cint); EXTDECL; external xml2lib;
(* Element *)
function xmlAddElementDecl(ctxt: xmlValidCtxtPtr; dtd: xmlDtdPtr; name: xmlCharPtr; _type: xmlElementTypeVal; content: xmlElementContentPtr): xmlElementPtr; EXTDECL; external xml2lib;
{$IFDEF LIBXML_TREE_ENABLED}
function xmlCopyElementTable(table: xmlElementTablePtr): xmlElementTablePtr; EXTDECL; external xml2lib;
{$ENDIF} (* LIBXML_TREE_ENABLED *)
procedure xmlFreeElementTable(table: xmlElementTablePtr); EXTDECL; external xml2lib;
{$IFDEF LIBXML_OUTPUT_ENABLED}
procedure xmlDumpElementTable(buf: xmlBufferPtr; table: xmlElementTablePtr); EXTDECL; external xml2lib;
procedure xmlDumpElementDecl(buf: xmlBufferPtr; elem: xmlElementPtr); EXTDECL; external xml2lib;
{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
(* Enumeration *)
function xmlCreateEnumeration(name: xmlCharPtr): xmlEnumerationPtr; EXTDECL; external xml2lib;
procedure xmlFreeEnumeration(cur: xmlEnumerationPtr); EXTDECL; external xml2lib;
{$IFDEF LIBXML_TREE_ENABLED}
function xmlCopyEnumeration(cur: xmlEnumerationPtr): xmlEnumerationPtr; EXTDECL; external xml2lib;
{$ENDIF} (* LIBXML_TREE_ENABLED *)
(* Attribute *)
function xmlAddAttributeDecl(ctxt: xmlValidCtxtPtr; dtd: xmlDtdPtr; elem, name, ns: xmlCharPtr; _type: xmlAttributeType;
def: xmlAttributeDefault; defaultValue: xmlCharPtr; tree: xmlEnumerationPtr): xmlAttributePtr; EXTDECL; external xml2lib;
{$IFDEF LIBXML_TREE_ENABLED}
function xmlCopyAttributeTable(table: xmlAttributeTablePtr): xmlAttributeTablePtr; EXTDECL; external xml2lib;
{$ENDIF} (* LIBXML_TREE_ENABLED *)
procedure xmlFreeAttributeTable(table: xmlAttributeTablePtr); EXTDECL; external xml2lib;
{$IFDEF LIBXML_OUTPUT_ENABLED}
procedure xmlDumpAttributeTable(buf: xmlBufferPtr; table: xmlAttributeTablePtr); EXTDECL; external xml2lib;
procedure xmlDumpAttributeDecl(buf: xmlBufferPtr; attr: xmlAttributePtr); EXTDECL; external xml2lib;
{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
(* IDs *)
function xmlAddID(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; value: xmlCharPtr; attr: xmlAttrPtr): xmlIDPtr; EXTDECL; external xml2lib;
procedure xmlFreeIDTable(table: xmlIDTablePtr); EXTDECL; external xml2lib;
function xmlGetID(doc: xmlDocPtr; ID: xmlCharPtr): xmlAttrPtr; EXTDECL; external xml2lib;
function xmlIsID(doc: xmlDocPtr; elem: xmlNodePtr; attr: xmlAttrPtr): cint; EXTDECL; external xml2lib;
function xmlRemoveID(doc: xmlDocPtr; attr: xmlAttrPtr): cint; EXTDECL; external xml2lib;
(* IDREFs *)
function xmlAddRef(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; value: xmlCharPtr; attr: xmlAttrPtr): xmlRefPtr; EXTDECL; external xml2lib;
procedure xmlFreeRefTable(table: xmlRefTablePtr); EXTDECL; external xml2lib;
function xmlIsRef(doc: xmlDocPtr; elem: xmlNodePtr; attr: xmlAttrPtr): cint; EXTDECL; external xml2lib;
function xmlRemoveRef(doc: xmlDocPtr; attr: xmlAttrPtr): cint; EXTDECL; external xml2lib;
function xmlGetRefs(doc: xmlDocPtr; ID: xmlCharPtr): xmlListPtr; EXTDECL; external xml2lib;
(**
* The public function calls related to validity checking.
*)
{$IFDEF LIBXML_VALID_ENABLED}
(* Allocate/Release Validation Contexts *)
function xmlNewValidCtxt: xmlValidCtxtPtr; EXTDECL; external xml2lib;
procedure xmlFreeValidCtxt(table: xmlValidCtxtPtr); EXTDECL; external xml2lib;
function xmlValidateRoot(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr): cint; EXTDECL; external xml2lib;
function xmlValidateElementDecl(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; elem: xmlElementPtr): cint; EXTDECL; external xml2lib;
function xmlValidNormalizeAttributeValue(doc: xmlDocPtr; elem: xmlNodePtr; name, value: xmlCharPtr): xmlCharPtr; EXTDECL; external xml2lib;
function xmlValidCtxtNormalizeAttributeValue(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; elem: xmlNodePtr; name, value: xmlCharPtr): xmlCharPtr; EXTDECL; external xml2lib;
function xmlValidateAttributeDecl(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; attr: xmlAttributePtr): cint; EXTDECL; external xml2lib;
function xmlValidateAttributeValue(_type: xmlAttributeType; value: xmlCharPtr): cint; EXTDECL; external xml2lib;
function xmlValidateNotationDecl(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; nota: xmlNotationPtr): cint; EXTDECL; external xml2lib;
function xmlValidateDtd(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; dtd: xmlDtdPtr): cint; EXTDECL; external xml2lib;
function xmlValidateDtdFinal(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr): cint; EXTDECL; external xml2lib;
function xmlValidateDocument(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr): cint; EXTDECL; external xml2lib;
function xmlValidateElement(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; elem: xmlNodePtr): cint; EXTDECL; external xml2lib;
function xmlValidateOneElement(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; elem: xmlNodePtr): cint; EXTDECL; external xml2lib;
function xmlValidateOneAttribute(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; elem: xmlNodePtr; attr: xmlAttrPtr; value: xmlCharPtr): cint; EXTDECL; external xml2lib;
function xmlValidateOneNamespace(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; elem: xmlNodePtr; prefix: xmlCharPtr; ns: xmlNsPtr; value: xmlCharPtr): cint; EXTDECL; external xml2lib;
function xmlValidateDocumentFinal(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr): cint; EXTDECL; external xml2lib;
{$ENDIF} (* LIBXML_VALID_ENABLED *)
{$IF defined(LIBXML_VALID_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
function xmlValidateNotationUse(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; notationName: xmlCharPtr): cint; EXTDECL; external xml2lib;
{$ENDIF} (* LIBXML_VALID_ENABLED or LIBXML_SCHEMAS_ENABLED *)
function xmlIsMixedElement(doc: xmlDocPtr; name: xmlCharPtr): cint; EXTDECL; external xml2lib;
function xmlGetDtdAttrDesc(dtd: xmlDtdPtr; elem, name: xmlCharPtr): xmlAttributePtr; EXTDECL; external xml2lib;
function xmlGetDtdQAttrDesc(dtd: xmlDtdPtr; elem, name, prefix: xmlCharPtr): xmlAttributePtr; EXTDECL; external xml2lib;
function xmlGetDtdNotationDesc(dtd: xmlDtdPtr; name: xmlCharPtr): xmlNotationPtr; EXTDECL; external xml2lib;
function xmlGetDtdQElementDesc(dtd: xmlDtdPtr; name, prefix: xmlCharPtr): xmlElementPtr; EXTDECL; external xml2lib;
function xmlGetDtdElementDesc(dtd: xmlDtdPtr; name: xmlCharPtr): xmlElementPtr; EXTDECL; external xml2lib;
{$IFDEF LIBXML_VALID_ENABLED}
function xmlGetDtdElementDesc(ctree: xmlElementContentPtr; var names: xmlCharPtr; var len: cint; max: cint): cint; EXTDECL; external xml2lib;
function xmlValidGetValidElements(prev, next: xmlNodePtr; var names: xmlCharPtr; max: cint): cint; EXTDECL; external xml2lib;
function xmlValidateNameValue(value: xmlCharPtr): cint; EXTDECL; external xml2lib;
function xmlValidateNamesValue(value: xmlCharPtr): cint; EXTDECL; external xml2lib;
function xmlValidateNmtokenValue(value: xmlCharPtr): cint; EXTDECL; external xml2lib;
function xmlValidateNmtokensValue(value: xmlCharPtr): cint; EXTDECL; external xml2lib;
{$IFDEF LIBXML_REGEXP_ENABLED}
(*
* Validation based on the regexp support
*)
function xmlValidBuildContentModel(ctxt: xmlValidCtxtPtr; elem: xmlElementPtr): cint; EXTDECL; external xml2lib;
function xmlValidatePushElement(ctxt: xmlValidCtxtPtr; doc: xmlNodePtr; elem: xmlElementPtr; qname: xmlCharPtr): cint; EXTDECL; external xml2lib;
function xmlValidatePushCData(ctxt: xmlValidCtxtPtr; data: xmlCharPtr; len: cint): cint; EXTDECL; external xml2lib;
function xmlValidatePopElement(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; elem: xmlNodePtr; qname: xmlCharPtr): cint; EXTDECL; external xml2lib;
{$ENDIF} (* LIBXML_REGEXP_ENABLED *)
{$ENDIF} (* LIBXML_VALID_ENABLED *)
{$ENDIF}
|