From be1849876f44cb10ccd8c5e1ec03b18c866e8b00 Mon Sep 17 00:00:00 2001 From: Lukasz Czerwinski Date: Tue, 9 Feb 2016 19:20:32 -0800 Subject: [PATCH] Add support for CDATA nodes --- lib/xmlrpc_lib.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/xmlrpc_lib.js b/lib/xmlrpc_lib.js index e97c914..7f0df5e 100644 --- a/lib/xmlrpc_lib.js +++ b/lib/xmlrpc_lib.js @@ -2492,10 +2492,11 @@ function getSingleChild(node, expectedType) function getChildText(node) { var ret = ''; + var child; for(var i = 0; i < node.childNodes.length; i++) { child = node.childNodes.item(i); - if (child.nodeType == 3) // ignore comments (8), character data (3), ... + if (child.nodeType == 3 || child.nodeType == 4) // handle text and cdata, ignore comments (8), ... { ret += String(child.nodeValue) }