| 509 | /* precondition: </ consumed */ |
| 510 | |
| 511 | private final void parseEndTag() |
| 512 | throws IOException, XmlPullParserException { |
| 513 | |
| 514 | read(); // '<' |
| 515 | read(); // '/' |
| 516 | name = readName(); |
| 517 | skip(); |
| 518 | read('>'); |
| 519 | |
| 520 | int sp = (depth - 1) << 2; |
| 521 | |
| 522 | if (depth == 0) { |
| 523 | error("element stack empty"); |
| 524 | type = COMMENT; |
| 525 | return; |
| 526 | } |
| 527 | |
| 528 | if (!name.equals(elementStack[sp + 3])) { |
| 529 | error("expected: /" + elementStack[sp + 3] + " read: " + name); |
| 530 | |
| 531 | // become case insensitive in relaxed mode |
| 532 | |
| 533 | int probe = sp; |
| 534 | while (probe >= 0 && !name.toLowerCase().equals(elementStack[probe + 3].toLowerCase())) { |
| 535 | stackMismatch++; |
| 536 | probe -= 4; |
| 537 | } |
| 538 | |
| 539 | if (probe < 0) { |
| 540 | stackMismatch = 0; |
| 541 | // text = "unexpected end tag ignored"; |
| 542 | type = COMMENT; |
| 543 | return; |
| 544 | } |
| 545 | } |
| 546 | |
| 547 | namespace = elementStack[sp]; |
| 548 | prefix = elementStack[sp + 1]; |
| 549 | name = elementStack[sp + 2]; |
| 550 | } |
| 551 | |
| 552 | private final int peekType() throws IOException { |
| 553 | switch (peek(0)) { |