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

Method parseEndTag

src/org/kxml2/io/KXmlParser.java:511–550  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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)) {

Callers 1

nextImplMethod · 0.95

Calls 6

readMethod · 0.95
readNameMethod · 0.95
skipMethod · 0.95
errorMethod · 0.95
toLowerCaseMethod · 0.80
equalsMethod · 0.45

Tested by

no test coverage detected