1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-24 13:33:01 +03:00

parser: Rework parsing of attribute and entity values

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.
This commit is contained in:
Nick Wellnhofer
2023-12-30 02:50:34 +01:00
parent 4dcc2d743e
commit 37c6618be5
16 changed files with 1080 additions and 1033 deletions

View File

@@ -87,4 +87,8 @@ XML_HIDDEN xmlParserInputPtr
xmlNewInputPush(xmlParserCtxtPtr ctxt, const char *url,
const char *chunk, int size, const char *encoding);
XML_HIDDEN xmlChar *
xmlExpandEntitiesInAttValue(xmlParserCtxtPtr ctxt, const xmlChar *str,
int normalize);
#endif /* XML_PARSER_H_PRIVATE__ */