Skip to content

Commit be18498

Browse files
author
Lukasz Czerwinski
committed
Add support for CDATA nodes
1 parent 2270908 commit be18498

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/xmlrpc_lib.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2492,10 +2492,11 @@ function getSingleChild(node, expectedType)
24922492
function getChildText(node)
24932493
{
24942494
var ret = '';
2495+
var child;
24952496
for(var i = 0; i < node.childNodes.length; i++)
24962497
{
24972498
child = node.childNodes.item(i);
2498-
if (child.nodeType == 3) // ignore comments (8), character data (3), ...
2499+
if (child.nodeType == 3 || child.nodeType == 4) // handle text and cdata, ignore comments (8), ...
24992500
{
25002501
ret += String(child.nodeValue)
25012502
}

0 commit comments

Comments
 (0)