From 57c88e43cbdb24bab019b95d653d8bcc89635fc5 Mon Sep 17 00:00:00 2001 From: Dominik Gmiterko Date: Thu, 11 May 2017 12:46:18 +0200 Subject: [PATCH] Fix reading schema elemnts while transforming xml to object --- lib/wsdl.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/wsdl.js b/lib/wsdl.js index 51f9fcc..cb8bc72 100644 --- a/lib/wsdl.js +++ b/lib/wsdl.js @@ -745,8 +745,8 @@ WSDL.prototype.xmlToObject = function(xml) { if(!refs[id]) refs[id] = {hrefs:[],obj:null}; } - if (topSchema && topSchema[name+'[]']) name = name + '[]'; - stack.push({name: originalName, object: obj, schema: topSchema && topSchema[name], id:attrs.id}); + if (topSchema && topSchema['$'+name+'[]']) name = name + '[]'; + stack.push({name: originalName, object: obj, schema: topSchema && topSchema['$'+name], id:attrs.id}); }) //p.on('endElement', function(nsName) { @@ -760,7 +760,7 @@ WSDL.prototype.xmlToObject = function(xml) { topSchema = top.schema, name = splitNSName(nsName).name; - if (topSchema && topSchema[name+'[]'] && typeof topSchema[name+'[]']!=='string') { + if (topSchema && topSchema['$'+name+'[]'] && typeof topSchema['$'+name+'[]']!=='string') { if (!topObject[name]) topObject[name] = []; topObject[name].push(obj); }