From 2874f6f21dc22efab1a2884fe463c5461955a225 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Fri, 8 Jan 2016 08:37:26 -0800 Subject: Add initial support for parse_embed_pcdata When this flag is true, PCDATA value is saved to the parent element instead of allocating a new node. This prevents some documents from round-tripping since it loses information, but can provide a significant memory reduction and parsing speedup for some documents. --- src/pugixml.hpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/pugixml.hpp') diff --git a/src/pugixml.hpp b/src/pugixml.hpp index 540e6ba..4ed6f55 100644 --- a/src/pugixml.hpp +++ b/src/pugixml.hpp @@ -158,6 +158,11 @@ namespace pugi // is a valid document. This flag is off by default. const unsigned int parse_fragment = 0x1000; + // This flag determines if plain character data is be stored in the parent element's value. This significantly changes the structure of + // the document and does not allow some documents to round-trip; this flag is only recommended for parsing documents with a lot of + // PCDATA nodes in a very memory-constrained environment. This flag is off by default. + const unsigned int parse_embed_pcdata = 0x2000; + // The default parsing mode. // Elements, PCDATA and CDATA sections are added to the DOM tree, character/reference entities are expanded, // End-of-Line characters are normalized, attribute values are normalized using CDATA normalization rules. -- cgit v1.2.3 From 71d3a797f4c1991070afb868e584f1ab3e8ad669 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Tue, 12 Jan 2016 20:18:12 -0800 Subject: Adjust parse_embed_pcdata documentation Since round-tripping should not be a problem any more don't mention it. --- src/pugixml.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/pugixml.hpp') diff --git a/src/pugixml.hpp b/src/pugixml.hpp index 4ed6f55..e561490 100644 --- a/src/pugixml.hpp +++ b/src/pugixml.hpp @@ -159,8 +159,8 @@ namespace pugi const unsigned int parse_fragment = 0x1000; // This flag determines if plain character data is be stored in the parent element's value. This significantly changes the structure of - // the document and does not allow some documents to round-trip; this flag is only recommended for parsing documents with a lot of - // PCDATA nodes in a very memory-constrained environment. This flag is off by default. + // the document; this flag is only recommended for parsing documents with many PCDATA nodes in memory-constrained environments. + // This flag is off by default. const unsigned int parse_embed_pcdata = 0x2000; // The default parsing mode. -- cgit v1.2.3