@@ -136,17 +136,19 @@ function DashParser(config) {
136
136
}
137
137
138
138
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' ) ;
140
141
141
142
function processNode ( node ) {
142
143
// Convert tag name
143
144
let p = node . nodeName . indexOf ( ':' ) ;
144
145
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 ;
147
148
}
148
149
149
- const { children, attributes, nodeName } = node ;
150
+ const { childNodes, attributes, nodeName } = node ;
151
+ node . tagName = nodeName ;
150
152
151
153
// Convert attributes
152
154
for ( let k in attributes ) {
@@ -169,10 +171,10 @@ function DashParser(config) {
169
171
}
170
172
171
173
// Convert children
172
- const len = children ?. length ;
174
+ const len = childNodes ?. length ;
173
175
174
176
for ( let i = 0 ; i < len ; i ++ ) {
175
- const child = children [ i ] ;
177
+ const child = childNodes [ i ] ;
176
178
177
179
if ( child . nodeName === '#text' ) {
178
180
node . __text = child . nodeValue ;
@@ -196,7 +198,7 @@ function DashParser(config) {
196
198
}
197
199
}
198
200
199
- node . __children = children ;
201
+ node . __children = childNodes ;
200
202
}
201
203
202
204
processNode ( root ) ;
0 commit comments