Sets name and attributes
(boolean xmldecl)
| 598 | /** Sets name and attributes */ |
| 599 | |
| 600 | private final void parseStartTag(boolean xmldecl) |
| 601 | throws IOException, XmlPullParserException { |
| 602 | |
| 603 | if (!xmldecl) |
| 604 | read(); |
| 605 | name = readName(); |
| 606 | attributeCount = 0; |
| 607 | |
| 608 | while (true) { |
| 609 | skip(); |
| 610 | |
| 611 | int c = peek(0); |
| 612 | |
| 613 | if (xmldecl) { |
| 614 | if (c == '?') { |
| 615 | read(); |
| 616 | read('>'); |
| 617 | return; |
| 618 | } |
| 619 | } |
| 620 | else { |
| 621 | if (c == '/') { |
| 622 | degenerated = true; |
| 623 | read(); |
| 624 | skip(); |
| 625 | read('>'); |
| 626 | break; |
| 627 | } |
| 628 | |
| 629 | if (c == '>' && !xmldecl) { |
| 630 | read(); |
| 631 | break; |
| 632 | } |
| 633 | } |
| 634 | |
| 635 | if (c == -1) { |
| 636 | error(UNEXPECTED_EOF); |
| 637 | //type = COMMENT; |
| 638 | return; |
| 639 | } |
| 640 | |
| 641 | String attrName = readName(); |
| 642 | |
| 643 | if (attrName.length() == 0) { |
| 644 | error("attr name expected"); |
| 645 | //type = COMMENT; |
| 646 | break; |
| 647 | } |
| 648 | |
| 649 | int i = (attributeCount++) << 2; |
| 650 | |
| 651 | attributes = ensureCapacity(attributes, i + 4); |
| 652 | |
| 653 | attributes[i++] = ""; |
| 654 | attributes[i++] = null; |
| 655 | attributes[i++] = attrName; |
| 656 | |
| 657 | skip(); |