From ca3807d9467e3a600e6e0ebbad73aa8d6b2f6179 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Wed, 24 Aug 2022 15:55:46 +0200 Subject: [PATCH] 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. xmlKeepBlanksDefault ()
int	xmlKeepBlanksDefault		(int val)
-

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.

+

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'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.

@@ -1872,7 +1872,7 @@ The content of this structure is not made public by the API. xmlLineNumbersDefault ()
int	xmlLineNumbersDefault		(int val)
-

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.

+

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.

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?'/> - 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. + 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'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. @@ -10732,7 +10732,7 @@ Could we use @subtypes for this?'/> - 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. + 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. 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