summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2016-01-08 08:40:56 -0800
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2016-01-08 08:40:56 -0800
commit8b01f8923c047edf904c766c59ac359b807e7643 (patch)
tree9fd5e1890e1c3ac887d0ee6ecbfa3c3aa55f9ee1
parent2874f6f21dc22efab1a2884fe463c5461955a225 (diff)
Support xml_node::child_value/text for parse_embed_pcdata
-rw-r--r--src/pugixml.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp
index de87dcf..8c5b9e1 100644
--- a/src/pugixml.cpp
+++ b/src/pugixml.cpp
@@ -5464,6 +5464,10 @@ namespace pugi
if (impl::is_text_node(i) && i->value)
return i->value;
+ // element nodes can have value if parse_embed_pcdata was used
+ if (PUGI__NODETYPE(_root) == node_element && _root->value)
+ return _root->value;
+
return PUGIXML_TEXT("");
}
@@ -6211,6 +6215,10 @@ namespace pugi
if (impl::is_text_node(node))
return node;
+ // element nodes can have value if parse_embed_pcdata was used
+ if (PUGI__NODETYPE(_root) == node_element && _root->value)
+ return _root;
+
return 0;
}