(boolean push)
| 337 | } |
| 338 | |
| 339 | private final int parseLegacy(boolean push) |
| 340 | throws IOException, XmlPullParserException { |
| 341 | |
| 342 | String req = ""; |
| 343 | int term; |
| 344 | int result; |
| 345 | int prev = 0; |
| 346 | |
| 347 | read(); // < |
| 348 | int c = read(); |
| 349 | |
| 350 | if (c == '?') { |
| 351 | if ((peek(0) == 'x' || peek(0) == 'X') |
| 352 | && (peek(1) == 'm' || peek(1) == 'M')) { |
| 353 | |
| 354 | if (push) { |
| 355 | push(peek(0)); |
| 356 | push(peek(1)); |
| 357 | } |
| 358 | read(); |
| 359 | read(); |
| 360 | |
| 361 | if ((peek(0) == 'l' || peek(0) == 'L') && peek(1) <= ' ') { |
| 362 | |
| 363 | if (line != 1 || column > 4) |
| 364 | error("PI must not start with xml"); |
| 365 | |
| 366 | parseStartTag(true); |
| 367 | |
| 368 | if (attributeCount < 1 || !"version".equals(attributes[2])) |
| 369 | error("version expected"); |
| 370 | |
| 371 | version = attributes[3]; |
| 372 | |
| 373 | int pos = 1; |
| 374 | |
| 375 | if (pos < attributeCount |
| 376 | && "encoding".equals(attributes[2 + 4])) { |
| 377 | encoding = attributes[3 + 4]; |
| 378 | pos++; |
| 379 | } |
| 380 | |
| 381 | if (pos < attributeCount |
| 382 | && "standalone".equals(attributes[4 * pos + 2])) { |
| 383 | String st = attributes[3 + 4 * pos]; |
| 384 | if ("yes".equals(st)) |
| 385 | standalone = new Boolean(true); |
| 386 | else if ("no".equals(st)) |
| 387 | standalone = new Boolean(false); |
| 388 | else |
| 389 | error("illegal standalone value: " + st); |
| 390 | pos++; |
| 391 | } |
| 392 | |
| 393 | if (pos != attributeCount) |
| 394 | error("illegal xmldecl"); |
| 395 | |
| 396 | isWhitespace = true; |
no test coverage detected