mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-01-26 10:03:34 +03:00
37c6618be5
Don't use a separate function to handle "complex" attributes. Validate UTF-8 byte sequences without decoding. This should improve performance considerably when parsing multi-byte UTF-8 sequences. Use a string buffer to avoid unnecessary allocations and copying when expanding entities. Normalize attribute values in a single pass while expanding entities. Be more lenient in recovery mode. If no entity substitution was requested, validate entities without expanding. Fixes #596. Also fixes #655.
28 lines
726 B
C
28 lines
726 B
C
#ifndef XML_ENTITIES_H_PRIVATE__
|
|
#define XML_ENTITIES_H_PRIVATE__
|
|
|
|
#include <libxml/tree.h>
|
|
#include <libxml/xmlstring.h>
|
|
|
|
/*
|
|
* Entity flags
|
|
*
|
|
* XML_ENT_PARSED: The entity was parsed and `children` points to the
|
|
* content.
|
|
*
|
|
* XML_ENT_CHECKED: The entity was checked for loops and amplification.
|
|
* expandedSize was set.
|
|
*
|
|
* XML_ENT_VALIDATED: The entity contains a valid attribute value.
|
|
* Only used when entities aren't substituted.
|
|
*/
|
|
#define XML_ENT_PARSED (1u << 0)
|
|
#define XML_ENT_CHECKED (1u << 1)
|
|
#define XML_ENT_VALIDATED (1u << 2)
|
|
#define XML_ENT_EXPANDING (1u << 3)
|
|
|
|
XML_HIDDEN xmlChar *
|
|
xmlEncodeAttributeEntities(xmlDocPtr doc, const xmlChar *input);
|
|
|
|
#endif /* XML_ENTITIES_H_PRIVATE__ */
|