Skip to content

Commit 3513d76

Browse files
committed
Improve documentation of globals
Document more global variables as deprecated. Some of the variables don't generate deprecation warnings yet, but they shouldn't be used in new code.
1 parent f703ed6 commit 3513d76

File tree

3 files changed

+62
-21
lines changed

3 files changed

+62
-21
lines changed

doc/devhelp/libxml2-globals.html

+10-10
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ <h2>Details</h2>
166166
</div>
167167
<hr/>
168168
<div class="refsect2" lang="en"><h3><a name="xmlDeregisterNodeDefaultValue">Variable </a>xmlDeregisterNodeDefaultValue</h3><pre class="programlisting"><a href="libxml2-globals.html#xmlDeregisterNodeFunc">xmlDeregisterNodeFunc</a> xmlDeregisterNodeDefaultValue;
169-
</pre><p/>
169+
</pre><p>DEPRECATED: Don't use</p>
170170
</div>
171171
<hr/>
172172
<div class="refsect2" lang="en"><h3><a name="xmlDoValidityCheckingDefaultValue">Variable </a>xmlDoValidityCheckingDefaultValue</h3><pre class="programlisting">int xmlDoValidityCheckingDefaultValue;
173-
</pre><p>Global setting, indicate that the parser should work in validating mode. Disabled by default.</p>
173+
</pre><p>DEPRECATED: Use the modern options API with XML_PARSE_DTDVALID. Global setting, indicate that the parser should work in validating mode. Disabled by default.</p>
174174
</div>
175175
<hr/>
176176
<div class="refsect2" lang="en"><h3><a name="xmlFree">Variable </a>xmlFree</h3><pre class="programlisting"><a href="libxml2-xmlmemory.html#xmlFreeFunc">xmlFreeFunc</a> xmlFree;
@@ -186,15 +186,15 @@ <h2>Details</h2>
186186
</div>
187187
<hr/>
188188
<div class="refsect2" lang="en"><h3><a name="xmlGetWarningsDefaultValue">Variable </a>xmlGetWarningsDefaultValue</h3><pre class="programlisting">int xmlGetWarningsDefaultValue;
189-
</pre><p>Global setting, indicate that the parser should provide warnings. Activated by default.</p>
189+
</pre><p>DEPRECATED: Don't use Global setting, indicate that the DTD validation should provide warnings. Activated by default.</p>
190190
</div>
191191
<hr/>
192192
<div class="refsect2" lang="en"><h3><a name="xmlIndentTreeOutput">Variable </a>xmlIndentTreeOutput</h3><pre class="programlisting">int xmlIndentTreeOutput;
193193
</pre><p>Global setting, asking the serializer to indent the output tree by default Enabled by default</p>
194194
</div>
195195
<hr/>
196196
<div class="refsect2" lang="en"><h3><a name="xmlKeepBlanksDefaultValue">Variable </a>xmlKeepBlanksDefaultValue</h3><pre class="programlisting">int xmlKeepBlanksDefaultValue;
197-
</pre><p>Global setting, indicate that the parser should keep all blanks nodes found in the content Activated by default, this is actually needed to have the parser conformant to the XML Recommendation, however the option is kept for some applications since this was libxml1 default behaviour.</p>
197+
</pre><p>DEPRECATED: Use the modern options API with XML_PARSE_NOBLANKS. Global setting, indicate that the parser should keep all blanks nodes found in the content Activated by default, this is actually needed to have the parser conformant to the XML Recommendation, however the option is kept for some applications since this was libxml1 default behaviour.</p>
198198
</div>
199199
<hr/>
200200
<div class="refsect2" lang="en"><h3><a name="xmlLastError">Variable </a>xmlLastError</h3><pre class="programlisting"><a href="libxml2-xmlerror.html#xmlError">xmlError</a> xmlLastError;
@@ -206,7 +206,7 @@ <h2>Details</h2>
206206
</div>
207207
<hr/>
208208
<div class="refsect2" lang="en"><h3><a name="xmlLoadExtDtdDefaultValue">Variable </a>xmlLoadExtDtdDefaultValue</h3><pre class="programlisting">int xmlLoadExtDtdDefaultValue;
209-
</pre><p>Global setting, indicate that the parser should load DTD while not validating. Disabled by default.</p>
209+
</pre><p>DEPRECATED: Use the modern options API with XML_PARSE_DTDLOAD. Global setting, indicate that the parser should load DTD while not validating. Disabled by default.</p>
210210
</div>
211211
<hr/>
212212
<div class="refsect2" lang="en"><h3><a name="xmlMalloc">Variable </a>xmlMalloc</h3><pre class="programlisting"><a href="libxml2-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> xmlMalloc;
@@ -222,15 +222,15 @@ <h2>Details</h2>
222222
</div>
223223
<hr/>
224224
<div class="refsect2" lang="en"><h3><a name="xmlOutputBufferCreateFilenameValue">Variable </a>xmlOutputBufferCreateFilenameValue</h3><pre class="programlisting"><a href="libxml2-globals.html#xmlOutputBufferCreateFilenameFunc">xmlOutputBufferCreateFilenameFunc</a> xmlOutputBufferCreateFilenameValue;
225-
</pre><p/>
225+
</pre><p>DEPRECATED: Don't use</p>
226226
</div>
227227
<hr/>
228228
<div class="refsect2" lang="en"><h3><a name="xmlParserDebugEntities">Variable </a>xmlParserDebugEntities</h3><pre class="programlisting">int xmlParserDebugEntities;
229-
</pre><p>Global setting, asking the parser to print out debugging information. while handling entities. Disabled by default</p>
229+
</pre><p>DEPRECATED: Don't use Global setting, asking the parser to print out debugging information. while handling entities. Disabled by default</p>
230230
</div>
231231
<hr/>
232232
<div class="refsect2" lang="en"><h3><a name="xmlParserInputBufferCreateFilenameValue">Variable </a>xmlParserInputBufferCreateFilenameValue</h3><pre class="programlisting"><a href="libxml2-globals.html#xmlParserInputBufferCreateFilenameFunc">xmlParserInputBufferCreateFilenameFunc</a> xmlParserInputBufferCreateFilenameValue;
233-
</pre><p/>
233+
</pre><p>DEPRECATED: Don't use</p>
234234
</div>
235235
<hr/>
236236
<div class="refsect2" lang="en"><h3><a name="xmlParserVersion">Variable </a>xmlParserVersion</h3><pre class="programlisting">const char * xmlParserVersion;
@@ -246,7 +246,7 @@ <h2>Details</h2>
246246
</div>
247247
<hr/>
248248
<div class="refsect2" lang="en"><h3><a name="xmlRegisterNodeDefaultValue">Variable </a>xmlRegisterNodeDefaultValue</h3><pre class="programlisting"><a href="libxml2-globals.html#xmlRegisterNodeFunc">xmlRegisterNodeFunc</a> xmlRegisterNodeDefaultValue;
249-
</pre><p/>
249+
</pre><p>DEPRECATED: Don't use</p>
250250
</div>
251251
<hr/>
252252
<div class="refsect2" lang="en"><h3><a name="xmlSaveNoEmptyTags">Variable </a>xmlSaveNoEmptyTags</h3><pre class="programlisting">int xmlSaveNoEmptyTags;
@@ -262,7 +262,7 @@ <h2>Details</h2>
262262
</div>
263263
<hr/>
264264
<div class="refsect2" lang="en"><h3><a name="xmlSubstituteEntitiesDefaultValue">Variable </a>xmlSubstituteEntitiesDefaultValue</h3><pre class="programlisting">int xmlSubstituteEntitiesDefaultValue;
265-
</pre><p>Global setting, indicate that the parser should not generate entity references but replace them with the actual content of the entity Disabled by default, this should be activated when using XPath since the XPath data model requires entities replacement and the XPath engine does not handle entities references transparently.</p>
265+
</pre><p>DEPRECATED: Use the modern options API with XML_PARSE_NOENT. Global setting, indicate that the parser should not generate entity references but replace them with the actual content of the entity Disabled by default, this should be activated when using XPath since the XPath data model requires entities replacement and the XPath engine does not handle entities references transparently.</p>
266266
</div>
267267
<hr/>
268268
<div class="refsect2" lang="en"><h3><a name="xmlTreeIndentString">Variable </a>xmlTreeIndentString</h3><pre class="programlisting">const char * xmlTreeIndentString;

doc/libxml2-api.xml

+18-10
Original file line numberDiff line numberDiff line change
@@ -6969,9 +6969,11 @@ Could we use @subtypes for this?'/>
69696969
<variable name='xmlDefaultSAXLocator' file='globals' type='xmlSAXLocator'>
69706970
<info>DEPRECATED: Don&apos;t use The default SAX Locator { getPublicId, getSystemId, getLineNumber, getColumnNumber}</info>
69716971
</variable>
6972-
<variable name='xmlDeregisterNodeDefaultValue' file='globals' type='xmlDeregisterNodeFunc'/>
6972+
<variable name='xmlDeregisterNodeDefaultValue' file='globals' type='xmlDeregisterNodeFunc'>
6973+
<info>DEPRECATED: Don&apos;t use</info>
6974+
</variable>
69736975
<variable name='xmlDoValidityCheckingDefaultValue' file='globals' type='int'>
6974-
<info>Global setting, indicate that the parser should work in validating mode. Disabled by default.</info>
6976+
<info>DEPRECATED: Use the modern options API with XML_PARSE_DTDVALID. Global setting, indicate that the parser should work in validating mode. Disabled by default.</info>
69756977
</variable>
69766978
<variable name='xmlFree' file='globals' type='xmlFreeFunc'>
69776979
<info>@mem: an already allocated block of memory The variable holding the libxml free() implementation</info>
@@ -6983,7 +6985,7 @@ Could we use @subtypes for this?'/>
69836985
<info>Global setting passed to generic error callbacks</info>
69846986
</variable>
69856987
<variable name='xmlGetWarningsDefaultValue' file='globals' type='int'>
6986-
<info>Global setting, indicate that the parser should provide warnings. Activated by default.</info>
6988+
<info>DEPRECATED: Don&apos;t use Global setting, indicate that the DTD validation should provide warnings. Activated by default.</info>
69876989
</variable>
69886990
<variable name='xmlIndentTreeOutput' file='globals' type='int'>
69896991
<info>Global setting, asking the serializer to indent the output tree by default Enabled by default</info>
@@ -6996,14 +6998,14 @@ Could we use @subtypes for this?'/>
69966998
<variable name='xmlIsIdeographicGroup' file='chvalid' type='const xmlChRangeGroup'/>
69976999
<variable name='xmlIsPubidChar_tab' file='chvalid' type='const unsigned charxmlIsPubidChar_tab[256]'/>
69987000
<variable name='xmlKeepBlanksDefaultValue' file='globals' type='int'>
6999-
<info>Global setting, indicate that the parser should keep all blanks nodes found in the content Activated by default, this is actually needed to have the parser conformant to the XML Recommendation, however the option is kept for some applications since this was libxml1 default behaviour.</info>
7001+
<info>DEPRECATED: Use the modern options API with XML_PARSE_NOBLANKS. Global setting, indicate that the parser should keep all blanks nodes found in the content Activated by default, this is actually needed to have the parser conformant to the XML Recommendation, however the option is kept for some applications since this was libxml1 default behaviour.</info>
70007002
</variable>
70017003
<variable name='xmlLastError' file='globals' type='xmlError'/>
70027004
<variable name='xmlLineNumbersDefaultValue' file='globals' type='int'>
70037005
<info>DEPRECATED: The modern options API always enables line numbers. Global setting, indicate that the parser should store the line number in the content field of elements in the DOM tree. Disabled by default since this may not be safe for old classes of application.</info>
70047006
</variable>
70057007
<variable name='xmlLoadExtDtdDefaultValue' file='globals' type='int'>
7006-
<info>Global setting, indicate that the parser should load DTD while not validating. Disabled by default.</info>
7008+
<info>DEPRECATED: Use the modern options API with XML_PARSE_DTDLOAD. Global setting, indicate that the parser should load DTD while not validating. Disabled by default.</info>
70077009
</variable>
70087010
<variable name='xmlMalloc' file='globals' type='xmlMallocFunc'>
70097011
<info>@size: the size requested in bytes The variable holding the libxml malloc() implementation Returns a pointer to the newly allocated block or NULL in case of error</info>
@@ -7014,11 +7016,15 @@ Could we use @subtypes for this?'/>
70147016
<variable name='xmlMemStrdup' file='globals' type='xmlStrdupFunc'>
70157017
<info>@str: a zero terminated string The variable holding the libxml strdup() implementation Returns the copy of the string or NULL in case of error</info>
70167018
</variable>
7017-
<variable name='xmlOutputBufferCreateFilenameValue' file='globals' type='xmlOutputBufferCreateFilenameFunc'/>
7019+
<variable name='xmlOutputBufferCreateFilenameValue' file='globals' type='xmlOutputBufferCreateFilenameFunc'>
7020+
<info>DEPRECATED: Don&apos;t use</info>
7021+
</variable>
70187022
<variable name='xmlParserDebugEntities' file='globals' type='int'>
7019-
<info>Global setting, asking the parser to print out debugging information. while handling entities. Disabled by default</info>
7023+
<info>DEPRECATED: Don&apos;t use Global setting, asking the parser to print out debugging information. while handling entities. Disabled by default</info>
7024+
</variable>
7025+
<variable name='xmlParserInputBufferCreateFilenameValue' file='globals' type='xmlParserInputBufferCreateFilenameFunc'>
7026+
<info>DEPRECATED: Don&apos;t use</info>
70207027
</variable>
7021-
<variable name='xmlParserInputBufferCreateFilenameValue' file='globals' type='xmlParserInputBufferCreateFilenameFunc'/>
70227028
<variable name='xmlParserMaxDepth' file='parserInternals' type='unsigned int'>
70237029
<info>arbitrary depth limit for the XML documents that we allow to process. This is not a limitation of the parser but a safety boundary feature. It can be disabled with the XML_PARSE_HUGE parser option.</info>
70247030
</variable>
@@ -7031,7 +7037,9 @@ Could we use @subtypes for this?'/>
70317037
<variable name='xmlRealloc' file='globals' type='xmlReallocFunc'>
70327038
<info>@mem: an already allocated block of memory @size: the new size requested in bytes The variable holding the libxml realloc() implementation Returns a pointer to the newly reallocated block or NULL in case of error</info>
70337039
</variable>
7034-
<variable name='xmlRegisterNodeDefaultValue' file='globals' type='xmlRegisterNodeFunc'/>
7040+
<variable name='xmlRegisterNodeDefaultValue' file='globals' type='xmlRegisterNodeFunc'>
7041+
<info>DEPRECATED: Don&apos;t use</info>
7042+
</variable>
70357043
<variable name='xmlSaveNoEmptyTags' file='globals' type='int'>
70367044
<info>Global setting, asking the serializer to not output empty tags as &lt;empty/&gt; but &lt;empty&gt;&lt;/empty&gt;. those two forms are indistinguishable once parsed. Disabled by default</info>
70377045
</variable>
@@ -7045,7 +7053,7 @@ Could we use @subtypes for this?'/>
70457053
<info>Global setting passed to structured error callbacks</info>
70467054
</variable>
70477055
<variable name='xmlSubstituteEntitiesDefaultValue' file='globals' type='int'>
7048-
<info>Global setting, indicate that the parser should not generate entity references but replace them with the actual content of the entity Disabled by default, this should be activated when using XPath since the XPath data model requires entities replacement and the XPath engine does not handle entities references transparently.</info>
7056+
<info>DEPRECATED: Use the modern options API with XML_PARSE_NOENT. Global setting, indicate that the parser should not generate entity references but replace them with the actual content of the entity Disabled by default, this should be activated when using XPath since the XPath data model requires entities replacement and the XPath engine does not handle entities references transparently.</info>
70497057
</variable>
70507058
<variable name='xmlTreeIndentString' file='globals' type='const char *'>
70517059
<info>The string used to do one-level indent. By default is equal to &quot; &quot; (two spaces)</info>

globals.c

+34-1
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ int oldXMLWDcompatibility = 0; /* DEPRECATED */
205205
/**
206206
* xmlParserDebugEntities:
207207
*
208+
* DEPRECATED: Don't use
209+
*
208210
* Global setting, asking the parser to print out debugging information.
209211
* while handling entities.
210212
* Disabled by default
@@ -214,6 +216,8 @@ static int xmlParserDebugEntitiesThrDef = 0;
214216
/**
215217
* xmlDoValidityCheckingDefaultValue:
216218
*
219+
* DEPRECATED: Use the modern options API with XML_PARSE_DTDVALID.
220+
*
217221
* Global setting, indicate that the parser should work in validating mode.
218222
* Disabled by default.
219223
*/
@@ -222,14 +226,18 @@ static int xmlDoValidityCheckingDefaultValueThrDef = 0;
222226
/**
223227
* xmlGetWarningsDefaultValue:
224228
*
225-
* Global setting, indicate that the parser should provide warnings.
229+
* DEPRECATED: Don't use
230+
*
231+
* Global setting, indicate that the DTD validation should provide warnings.
226232
* Activated by default.
227233
*/
228234
int xmlGetWarningsDefaultValue = 1;
229235
static int xmlGetWarningsDefaultValueThrDef = 1;
230236
/**
231237
* xmlLoadExtDtdDefaultValue:
232238
*
239+
* DEPRECATED: Use the modern options API with XML_PARSE_DTDLOAD.
240+
*
233241
* Global setting, indicate that the parser should load DTD while not
234242
* validating.
235243
* Disabled by default.
@@ -261,6 +269,8 @@ static int xmlLineNumbersDefaultValueThrDef = 0;
261269
/**
262270
* xmlKeepBlanksDefaultValue:
263271
*
272+
* DEPRECATED: Use the modern options API with XML_PARSE_NOBLANKS.
273+
*
264274
* Global setting, indicate that the parser should keep all blanks
265275
* nodes found in the content
266276
* Activated by default, this is actually needed to have the parser
@@ -272,6 +282,8 @@ static int xmlKeepBlanksDefaultValueThrDef = 1;
272282
/**
273283
* xmlSubstituteEntitiesDefaultValue:
274284
*
285+
* DEPRECATED: Use the modern options API with XML_PARSE_NOENT.
286+
*
275287
* Global setting, indicate that the parser should not generate entity
276288
* references but replace them with the actual content of the entity
277289
* Disabled by default, this should be activated when using XPath since
@@ -281,14 +293,35 @@ static int xmlKeepBlanksDefaultValueThrDef = 1;
281293
int xmlSubstituteEntitiesDefaultValue = 0;
282294
static int xmlSubstituteEntitiesDefaultValueThrDef = 0;
283295

296+
/**
297+
* xmlRegisterNodeDefaultValue:
298+
*
299+
* DEPRECATED: Don't use
300+
*/
284301
xmlRegisterNodeFunc xmlRegisterNodeDefaultValue = NULL;
285302
static xmlRegisterNodeFunc xmlRegisterNodeDefaultValueThrDef = NULL;
303+
304+
/**
305+
* xmlDeregisterNodeDefaultValue:
306+
*
307+
* DEPRECATED: Don't use
308+
*/
286309
xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue = NULL;
287310
static xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValueThrDef = NULL;
288311

312+
/**
313+
* xmlParserInputBufferCreateFilenameValue:
314+
*
315+
* DEPRECATED: Don't use
316+
*/
289317
xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue = NULL;
290318
static xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValueThrDef = NULL;
291319

320+
/**
321+
* xmlOutputBufferCreateFilenameValue:
322+
*
323+
* DEPRECATED: Don't use
324+
*/
292325
xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue = NULL;
293326
static xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValueThrDef = NULL;
294327

0 commit comments

Comments
 (0)