1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-26 00:37:43 +03:00

entities: Add XML_ENT_PARSED flag

To check whether an entity was already parsed, the code previously
tested whether "checked" was non-zero or "children" was non-null. The
"children" check could be unreliable because an empty entity also
results in an empty (NULL) node list. Use a separate flag to make this
check more reliable.
This commit is contained in:
Nick Wellnhofer
2022-12-19 15:26:46 +01:00
parent f34f184f8e
commit 481d79d44c
3 changed files with 20 additions and 8 deletions

View File

@@ -4,6 +4,14 @@
#include <libxml/tree.h>
#include <libxml/xmlstring.h>
/*
* Entity flags
*
* XML_ENT_PARSED: The entity was parsed and `children` points to the
* content.
*/
#define XML_ENT_PARSED (1<<0)
XML_HIDDEN xmlChar *
xmlEncodeAttributeEntities(xmlDocPtr doc, const xmlChar *input);