| 9582 | */ |
| 9583 | |
| 9584 | static void |
| 9585 | xmlParseEndTag2(xmlParserCtxtPtr ctxt, const xmlStartTag *tag) { |
| 9586 | const xmlChar *name; |
| 9587 | |
| 9588 | GROW; |
| 9589 | if ((RAW != '<') || (NXT(1) != '/')) { |
| 9590 | xmlFatalErr(ctxt, XML_ERR_LTSLASH_REQUIRED, NULL); |
| 9591 | return; |
| 9592 | } |
| 9593 | SKIP(2); |
| 9594 | |
| 9595 | if (tag->prefix == NULL) |
| 9596 | name = xmlParseNameAndCompare(ctxt, ctxt->name); |
| 9597 | else |
| 9598 | name = xmlParseQNameAndCompare(ctxt, ctxt->name, tag->prefix); |
| 9599 | |
| 9600 | /* |
| 9601 | * We should definitely be at the ending "S? '>'" part |
| 9602 | */ |
| 9603 | GROW; |
| 9604 | SKIP_BLANKS; |
| 9605 | if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) { |
| 9606 | xmlFatalErr(ctxt, XML_ERR_GT_REQUIRED, NULL); |
| 9607 | } else |
| 9608 | NEXT1; |
| 9609 | |
| 9610 | /* |
| 9611 | * [ WFC: Element Type Match ] |
| 9612 | * The Name in an element's end-tag must match the element type in the |
| 9613 | * start-tag. |
| 9614 | * |
| 9615 | */ |
| 9616 | if (name != (xmlChar*)1) { |
| 9617 | if (name == NULL) name = BAD_CAST "unparsable"; |
| 9618 | xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NAME_MISMATCH, |
| 9619 | "Opening and ending tag mismatch: %s line %d and %s\n", |
| 9620 | ctxt->name, tag->line, name); |
| 9621 | } |
| 9622 | |
| 9623 | /* |
| 9624 | * SAX: End of Tag |
| 9625 | */ |
| 9626 | if ((ctxt->sax != NULL) && (ctxt->sax->endElementNs != NULL) && |
| 9627 | (!ctxt->disableSAX)) |
| 9628 | ctxt->sax->endElementNs(ctxt->userData, ctxt->name, tag->prefix, |
| 9629 | tag->URI); |
| 9630 | |
| 9631 | spacePop(ctxt); |
| 9632 | if (tag->nsNr != 0) |
| 9633 | xmlParserNsPop(ctxt, tag->nsNr); |
| 9634 | } |
| 9635 | |
| 9636 | /** |
| 9637 | * xmlParseCDSect: |
no test coverage detected