MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlParseExternalID

Function xmlParseExternalID

ThirdParty/libxml2/vtklibxml2/parser.c:5041–5090  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5039 */
5040
5041xmlChar *
5042xmlParseExternalID(xmlParserCtxtPtr ctxt, xmlChar **publicID, int strict) {
5043 xmlChar *URI = NULL;
5044
5045 *publicID = NULL;
5046 if (CMP6(CUR_PTR, 'S', 'Y', 'S', 'T', 'E', 'M')) {
5047 SKIP(6);
5048 if (SKIP_BLANKS == 0) {
5049 xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
5050 "Space required after 'SYSTEM'\n");
5051 }
5052 URI = xmlParseSystemLiteral(ctxt);
5053 if (URI == NULL) {
5054 xmlFatalErr(ctxt, XML_ERR_URI_REQUIRED, NULL);
5055 }
5056 } else if (CMP6(CUR_PTR, 'P', 'U', 'B', 'L', 'I', 'C')) {
5057 SKIP(6);
5058 if (SKIP_BLANKS == 0) {
5059 xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
5060 "Space required after 'PUBLIC'\n");
5061 }
5062 *publicID = xmlParsePubidLiteral(ctxt);
5063 if (*publicID == NULL) {
5064 xmlFatalErr(ctxt, XML_ERR_PUBID_REQUIRED, NULL);
5065 }
5066 if (strict) {
5067 /*
5068 * We don't handle [83] so "S SystemLiteral" is required.
5069 */
5070 if (SKIP_BLANKS == 0) {
5071 xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
5072 "Space required after the Public Identifier\n");
5073 }
5074 } else {
5075 /*
5076 * We handle [83] so we return immediately, if
5077 * "S SystemLiteral" is not detected. We skip blanks if no
5078 * system literal was found, but this is harmless since we must
5079 * be at the end of a NotationDecl.
5080 */
5081 if (SKIP_BLANKS == 0) return(NULL);
5082 if ((CUR != '\'') && (CUR != '"')) return(NULL);
5083 }
5084 URI = xmlParseSystemLiteral(ctxt);
5085 if (URI == NULL) {
5086 xmlFatalErr(ctxt, XML_ERR_URI_REQUIRED, NULL);
5087 }
5088 }
5089 return(URI);
5090}
5091
5092/**
5093 * xmlParseCommentComplex:

Callers 3

xmlParseNotationDeclFunction · 0.85
xmlParseEntityDeclFunction · 0.85
xmlParseDocTypeDeclFunction · 0.85

Calls 3

xmlParseSystemLiteralFunction · 0.85
xmlFatalErrFunction · 0.85
xmlParsePubidLiteralFunction · 0.85

Tested by

no test coverage detected