* xmlParseEntityRefInternal: * @ctxt: an XML parser context * @inAttr: whether we are in an attribute value * * Parse an entity reference. Always consumes '&'. * * [68] EntityRef ::= '&' Name ';' * * Returns the name, or NULL in case of error. */
| 7682 | * Returns the name, or NULL in case of error. |
| 7683 | */ |
| 7684 | static const xmlChar * |
| 7685 | xmlParseEntityRefInternal(xmlParserCtxtPtr ctxt) { |
| 7686 | const xmlChar *name; |
| 7687 | |
| 7688 | GROW; |
| 7689 | |
| 7690 | if (RAW != '&') |
| 7691 | return(NULL); |
| 7692 | NEXT; |
| 7693 | name = xmlParseName(ctxt); |
| 7694 | if (name == NULL) { |
| 7695 | xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED, |
| 7696 | "xmlParseEntityRef: no name\n"); |
| 7697 | return(NULL); |
| 7698 | } |
| 7699 | if (RAW != ';') { |
| 7700 | xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL); |
| 7701 | return(NULL); |
| 7702 | } |
| 7703 | NEXT; |
| 7704 | |
| 7705 | return(name); |
| 7706 | } |
| 7707 | |
| 7708 | /** |
| 7709 | * xmlParseEntityRef: |
no test coverage detected