| 5612 | */ |
| 5613 | |
| 5614 | void |
| 5615 | xmlParseNotationDecl(xmlParserCtxtPtr ctxt) { |
| 5616 | const xmlChar *name; |
| 5617 | xmlChar *Pubid; |
| 5618 | xmlChar *Systemid; |
| 5619 | |
| 5620 | if ((CUR != '<') || (NXT(1) != '!')) |
| 5621 | return; |
| 5622 | SKIP(2); |
| 5623 | |
| 5624 | if (CMP8(CUR_PTR, 'N', 'O', 'T', 'A', 'T', 'I', 'O', 'N')) { |
| 5625 | int inputid = ctxt->input->id; |
| 5626 | SKIP(8); |
| 5627 | if (SKIP_BLANKS_PE == 0) { |
| 5628 | xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, |
| 5629 | "Space required after '<!NOTATION'\n"); |
| 5630 | return; |
| 5631 | } |
| 5632 | |
| 5633 | name = xmlParseName(ctxt); |
| 5634 | if (name == NULL) { |
| 5635 | xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_STARTED, NULL); |
| 5636 | return; |
| 5637 | } |
| 5638 | if (xmlStrchr(name, ':') != NULL) { |
| 5639 | xmlNsErr(ctxt, XML_NS_ERR_COLON, |
| 5640 | "colons are forbidden from notation names '%s'\n", |
| 5641 | name, NULL, NULL); |
| 5642 | } |
| 5643 | if (SKIP_BLANKS_PE == 0) { |
| 5644 | xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, |
| 5645 | "Space required after the NOTATION name'\n"); |
| 5646 | return; |
| 5647 | } |
| 5648 | |
| 5649 | /* |
| 5650 | * Parse the IDs. |
| 5651 | */ |
| 5652 | Systemid = xmlParseExternalID(ctxt, &Pubid, 0); |
| 5653 | SKIP_BLANKS_PE; |
| 5654 | |
| 5655 | if (RAW == '>') { |
| 5656 | if (inputid != ctxt->input->id) { |
| 5657 | xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, |
| 5658 | "Notation declaration doesn't start and stop" |
| 5659 | " in the same entity\n"); |
| 5660 | } |
| 5661 | NEXT; |
| 5662 | if ((ctxt->sax != NULL) && (!ctxt->disableSAX) && |
| 5663 | (ctxt->sax->notationDecl != NULL)) |
| 5664 | ctxt->sax->notationDecl(ctxt->userData, name, Pubid, Systemid); |
| 5665 | } else { |
| 5666 | xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_FINISHED, NULL); |
| 5667 | } |
| 5668 | if (Systemid != NULL) xmlFree(Systemid); |
| 5669 | if (Pubid != NULL) xmlFree(Pubid); |
| 5670 | } |
| 5671 | } |
no test coverage detected