summaryrefslogtreecommitdiff
path: root/src/pugixml.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pugixml.cpp')
-rw-r--r--src/pugixml.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp
index 35c0d8e..de87dcf 100644
--- a/src/pugixml.cpp
+++ b/src/pugixml.cpp
@@ -3360,13 +3360,22 @@ PUGI__NS_BEGIN
if (cursor->parent || PUGI__OPTSET(parse_fragment))
{
- PUGI__PUSHNODE(node_pcdata); // Append a new node on the tree.
- cursor->value = s; // Save the offset.
+ if (!PUGI__OPTSET(parse_embed_pcdata))
+ {
+ PUGI__PUSHNODE(node_pcdata); // Append a new node on the tree.
+
+ cursor->value = s; // Save the offset.
+
+ PUGI__POPNODE(); // Pop since this is a standalone.
+ }
+ else
+ {
+ if (cursor->parent && !cursor->value)
+ cursor->value = s; // Save the offset.
+ }
s = strconv_pcdata(s);
- PUGI__POPNODE(); // Pop since this is a standalone.
-
if (!*s) break;
}
else