MCPcopy Create free account
hub / github.com/dumbledore/AlbiteREADER / parseStartTag

Method parseStartTag

src/org/kxml2/io/KXmlParser.java:600–717  ·  view source on GitHub ↗

Sets name and attributes

(boolean xmldecl)

Source from the content-addressed store, hash-verified

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();

Callers 2

nextImplMethod · 0.95
parseLegacyMethod · 0.95

Calls 10

readMethod · 0.95
readNameMethod · 0.95
skipMethod · 0.95
peekMethod · 0.95
errorMethod · 0.95
ensureCapacityMethod · 0.95
pushTextMethod · 0.95
getMethod · 0.95
adjustNspMethod · 0.95
lengthMethod · 0.80

Tested by

no test coverage detected