mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-08-01 10:06:59 +03:00
Blanks handling function, added 2.x upgrade doc, Daniel
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
Sat Mar 4 12:38:41 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org>
|
||||||
|
|
||||||
|
* doc/upgrade.html: instruction on how to upgrade from 1.x to 2.x
|
||||||
|
added
|
||||||
|
* parser.c: adding xmlKeepBlanksDefault() as a way to manage
|
||||||
|
compatibility w.r.t. XML spec and existing code.
|
||||||
|
|
||||||
Thu Mar 2 04:45:15 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org>
|
Thu Mar 2 04:45:15 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org>
|
||||||
|
|
||||||
* parser.c: seems a better solution to <a> </a> exists,
|
* parser.c: seems a better solution to <a> </a> exists,
|
||||||
|
33
parser.c
33
parser.c
@ -8745,3 +8745,36 @@ xmlSubstituteEntitiesDefault(int val) {
|
|||||||
return(old);
|
return(old);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xmlKeepBlanksDefault:
|
||||||
|
* @val: int 0 or 1
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* ignorableWhitespace() 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 behaviour
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* Returns the last value for 0 for no substitution, 1 for substitution.
|
||||||
|
*/
|
||||||
|
|
||||||
|
int
|
||||||
|
xmlKeepBlanksDefault(int val) {
|
||||||
|
int old = xmlKeepBlanksDefaultValue;
|
||||||
|
|
||||||
|
xmlKeepBlanksDefaultValue = val;
|
||||||
|
xmlIndentTreeOutput = !val;
|
||||||
|
return(old);
|
||||||
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user