Skip to content

Commit f253718

Browse files
committed
no message
1 parent 72c2938 commit f253718

File tree

2 files changed

+9
-69
lines changed

2 files changed

+9
-69
lines changed

src/dash/parser/DashParser.js

+9-7
Original file line numberDiff line numberDiff line change
@@ -136,17 +136,19 @@ function DashParser(config) {
136136
}
137137

138138
function processXml(data) {
139-
const root = cmlParseXml(data).children.find(child => child.nodeName === 'MPD');
139+
const xml = cmlParseXml(data)
140+
const root = xml.childNodes.find(child => child.nodeName === 'MPD');
140141

141142
function processNode(node) {
142143
// Convert tag name
143144
let p = node.nodeName.indexOf(':');
144145
if (p !== -1) {
145-
node.__prefix = node.nodeName.substr(0, p);
146-
node.nodeName = node.nodeName.substr(p + 1);
146+
node.__prefix = node.prefix;
147+
node.nodeName = node.localName;
147148
}
148149

149-
const { children, attributes, nodeName } = node;
150+
const { childNodes, attributes, nodeName } = node;
151+
node.tagName = nodeName;
150152

151153
// Convert attributes
152154
for (let k in attributes) {
@@ -169,10 +171,10 @@ function DashParser(config) {
169171
}
170172

171173
// Convert children
172-
const len = children?.length;
174+
const len = childNodes?.length;
173175

174176
for (let i = 0; i < len; i++) {
175-
const child = children[i];
177+
const child = childNodes[i];
176178

177179
if (child.nodeName === '#text') {
178180
node.__text = child.nodeValue;
@@ -196,7 +198,7 @@ function DashParser(config) {
196198
}
197199
}
198200

199-
node.__children = children;
201+
node.__children = childNodes;
200202
}
201203

202204
processNode(root);

test/unit/test/externals/externals.tXml.js

-62
This file was deleted.

0 commit comments

Comments
 (0)