Skip to content

Commit 568b4ae

Browse files
committed
fix: remove code which looks for xml declaration
1 parent 36bb2b0 commit 568b4ae

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

src/dash/parser/DashParser.js

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -210,23 +210,9 @@ function DashParser(config) {
210210
try {
211211
const root = processXml(data);
212212

213-
let ret = {};
214-
// If root element is xml node, then get first child node as root
215-
if (root.tagName.toLowerCase().indexOf('xml') !== -1) {
216-
for (let key in root) {
217-
if (Array.isArray(root[key])) {
218-
ret[key] = root[key][0];
219-
break;
220-
} else if (typeof root[key] === 'object') {
221-
ret[key] = root[key];
222-
break;
223-
}
224-
}
225-
} else {
226-
ret[root.tagName] = root;
227-
delete root.tagName;
228-
}
229-
return ret;
213+
return {
214+
[root.tagName]: root
215+
};
230216
} catch (e) {
231217
return null;
232218
}

0 commit comments

Comments
 (0)