[libxml2] Mark more functions setting globals as deprecated



commit ca3807d9467e3a600e6e0ebbad73aa8d6b2f6179
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Wed Aug 24 15:55:46 2022 +0200

    Mark more functions setting globals as deprecated

 doc/devhelp/libxml2-parser.html | 4 ++--
 doc/libxml2-api.xml             | 4 ++--
 parserInternals.c               | 4 ++++
 3 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/doc/devhelp/libxml2-parser.html b/doc/devhelp/libxml2-parser.html
index 21fe1c85..bc37b594 100644
--- a/doc/devhelp/libxml2-parser.html
+++ b/doc/devhelp/libxml2-parser.html
@@ -1851,7 +1851,7 @@ The content of this structure is not made public by the API.
 <a name="xmlKeepBlanksDefault"></a>xmlKeepBlanksDefault ()</h3>
 <pre class="programlisting">int        xmlKeepBlanksDefault            (int val)<br>
 </pre>
-<p>Set and return the previous value for default blanks text nodes support. The 1.x version of the parser 
used an heuristic to try to detect ignorable white spaces. As a result the SAX callback was generating 
xmlSAX2IgnorableWhitespace() callbacks instead of characters() one, and when using the DOM output text nodes 
containing those blanks were not generated. The 2.x and later version will switch to the XML standard way and 
ignorableWhitespace() are only generated when running the parser in validating mode and when the current 
element doesn't allow CDATA or mixed content. This function is provided as a way to force the standard 
behavior on 1.X libs and to switch back to the old mode for compatibility when running 1.X client code on 2.X 
. Upgrade of 1.X code should be done by using xmlIsBlankNode() commodity function to detect the "empty" nodes 
generated. This value also affect autogeneration of indentation when saving code if blanks sections are kept, 
indentation is not generated.</
 p>
+<p>DEPRECATED: Use the modern options API with <a 
href="libxml2-parser.html#XML_PARSE_NOBLANKS">XML_PARSE_NOBLANKS</a>. Set and return the previous value for 
default blanks text nodes support. The 1.x version of the parser used an heuristic to try to detect ignorable 
white spaces. As a result the SAX callback was generating xmlSAX2IgnorableWhitespace() callbacks instead of 
characters() one, and when using the DOM output text nodes containing those blanks were not generated. The 
2.x and later version will switch to the XML standard way and ignorableWhitespace() are only generated when 
running the parser in validating mode and when the current element doesn't allow CDATA or mixed content. This 
function is provided as a way to force the standard behavior on 1.X libs and to switch back to the old mode 
for compatibility when running 1.X client code on 2.X . Upgrade of 1.X code should be done by using 
xmlIsBlankNode() commodity function to detect the "empty" nodes generated. This value al
 so affect autogeneration of indentation when saving code if blanks sections are kept, indentation is not 
generated.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1872,7 +1872,7 @@ The content of this structure is not made public by the API.
 <a name="xmlLineNumbersDefault"></a>xmlLineNumbersDefault ()</h3>
 <pre class="programlisting">int        xmlLineNumbersDefault           (int val)<br>
 </pre>
-<p>Set and return the previous value for enabling line numbers in elements contents. This may break on old 
application and is turned off by default.</p>
+<p>DEPRECATED: The modern options API always enables line numbers. Set and return the previous value for 
enabling line numbers in elements contents. This may break on old application and is turned off by 
default.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml
index 0bcdcdad..22a5184c 100644
--- a/doc/libxml2-api.xml
+++ b/doc/libxml2-api.xml
@@ -10721,7 +10721,7 @@ Could we use @subtypes for this?'/>
       <arg name='publicID' type='const xmlChar *' info='the public identifier'/>
     </function>
     <function name='xmlKeepBlanksDefault' file='parser' module='parserInternals'>
-      <info>Set and return the previous value for default blanks text nodes support. The 1.x version of the 
parser used an heuristic to try to detect ignorable white spaces. As a result the SAX callback was generating 
xmlSAX2IgnorableWhitespace() callbacks instead of characters() one, and when using the DOM output text nodes 
containing those blanks were not generated. The 2.x and later version will switch to the XML standard way and 
ignorableWhitespace() are only generated when running the parser in validating mode and when the current 
element doesn&apos;t allow CDATA or mixed content. This function is provided as a way to force the standard 
behavior on 1.X libs and to switch back to the old mode for compatibility when running 1.X client code on 2.X 
. Upgrade of 1.X code should be done by using xmlIsBlankNode() commodity function to detect the 
&quot;empty&quot; nodes generated. This value also affect autogeneration of indentation when saving code if 
blanks sections are kept, indenta
 tion is not generated.</info>
+      <info>DEPRECATED: Use the modern options API with XML_PARSE_NOBLANKS.  Set and return the previous 
value for default blanks text nodes support. The 1.x version of the parser used an heuristic to try to detect 
ignorable white spaces. As a result the SAX callback was generating xmlSAX2IgnorableWhitespace() callbacks 
instead of characters() one, and when using the DOM output text nodes containing those blanks were not 
generated. The 2.x and later version will switch to the XML standard way and ignorableWhitespace() are only 
generated when running the parser in validating mode and when the current element doesn&apos;t allow CDATA or 
mixed content. This function is provided as a way to force the standard behavior on 1.X libs and to switch 
back to the old mode for compatibility when running 1.X client code on 2.X . Upgrade of 1.X code should be 
done by using xmlIsBlankNode() commodity function to detect the &quot;empty&quot; nodes generated. This value 
also affect autogeneration of 
 indentation when saving code if blanks sections are kept, indentation is not generated.</info>
       <return type='int' info='the last value for 0 for no substitution, 1 for substitution.'/>
       <arg name='val' type='int' info='int 0 or 1'/>
     </function>
@@ -10732,7 +10732,7 @@ Could we use @subtypes for this?'/>
       <arg name='parent' type='xmlNodePtr' info='the parent node'/>
     </function>
     <function name='xmlLineNumbersDefault' file='parser' module='parserInternals'>
-      <info>Set and return the previous value for enabling line numbers in elements contents. This may break 
on old application and is turned off by default.</info>
+      <info>DEPRECATED: The modern options API always enables line numbers.  Set and return the previous 
value for enabling line numbers in elements contents. This may break on old application and is turned off by 
default.</info>
       <return type='int' info='the last value for 0 for no substitution, 1 for substitution.'/>
       <arg name='val' type='int' info='int 0 or 1'/>
     </function>
diff --git a/parserInternals.c b/parserInternals.c
index 56fdcb72..c74fab9f 100644
--- a/parserInternals.c
+++ b/parserInternals.c
@@ -2013,6 +2013,8 @@ xmlPedanticParserDefault(int val) {
  * xmlLineNumbersDefault:
  * @val:  int 0 or 1
  *
+ * DEPRECATED: The modern options API always enables line numbers.
+ *
  * Set and return the previous value for enabling line numbers in elements
  * contents. This may break on old application and is turned off by default.
  *
@@ -2055,6 +2057,8 @@ xmlSubstituteEntitiesDefault(int val) {
  * xmlKeepBlanksDefault:
  * @val:  int 0 or 1
  *
+ * DEPRECATED: Use the modern options API with XML_PARSE_NOBLANKS.
+ *
  * Set and return the previous value for default blanks text nodes support.
  * The 1.x version of the parser used an heuristic to try to detect
  * ignorable white spaces. As a result the SAX callback was generating


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]