We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36bb2b0 commit 568b4aeCopy full SHA for 568b4ae
src/dash/parser/DashParser.js
@@ -210,23 +210,9 @@ function DashParser(config) {
210
try {
211
const root = processXml(data);
212
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
223
- }
224
225
- } else {
226
- ret[root.tagName] = root;
227
- delete root.tagName;
228
229
- return ret;
+ return {
+ [root.tagName]: root
+ };
230
} catch (e) {
231
return null;
232
}
0 commit comments