* Read Processing insstructions and skip * @param {*} xmlData * @param {*} i
(xmlData, i)
| 199 | * @param {*} i |
| 200 | */ |
| 201 | function readPI(xmlData, i) { |
| 202 | const start = i; |
| 203 | for (; i < xmlData.length; i++) { |
| 204 | if (xmlData[i] == '?' || xmlData[i] == ' ') { |
| 205 | //tagname |
| 206 | const tagname = xmlData.substr(start, i - start); |
| 207 | if (i > 5 && tagname === 'xml') { |
| 208 | return getErrorObject('InvalidXml', 'XML declaration allowed only at the start of the document.', getLineNumberForPosition(xmlData, i)); |
| 209 | } else if (xmlData[i] == '?' && xmlData[i + 1] == '>') { |
| 210 | //check if valid attribut string |
| 211 | i++; |
| 212 | break; |
| 213 | } else { |
| 214 | continue; |
| 215 | } |
| 216 | } |
| 217 | } |
| 218 | return i; |
| 219 | } |
| 220 | |
| 221 | function readCommentAndCDATA(xmlData, i) { |
| 222 | if (xmlData.length > i + 5 && xmlData[i + 1] === '-' && xmlData[i + 2] === '-') { |
no test coverage detected