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

Function xmlParseStartTag2

ThirdParty/libxml2/vtklibxml2/parser.c:8973–9567  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8971 */
8972
8973static const xmlChar *
8974xmlParseStartTag2(xmlParserCtxtPtr ctxt, const xmlChar **pref,
8975 const xmlChar **URI, int *nbNsPtr) {
8976 xmlHashedString hlocalname;
8977 xmlHashedString hprefix;
8978 xmlHashedString hattname;
8979 xmlHashedString haprefix;
8980 const xmlChar *localname;
8981 const xmlChar *prefix;
8982 const xmlChar *attname;
8983 const xmlChar *aprefix;
8984 const xmlChar *uri;
8985 xmlChar *attvalue = NULL;
8986 const xmlChar **atts = ctxt->atts;
8987 unsigned attrHashSize = 0;
8988 int maxatts = ctxt->maxatts;
8989 int nratts, nbatts, nbdef;
8990 int i, j, nbNs, nbTotalDef, attval, nsIndex, maxAtts;
8991 int alloc = 0;
8992 int numNsErr = 0;
8993 int numDupErr = 0;
8994
8995 if (RAW != '<') return(NULL);
8996 NEXT1;
8997
8998 nbatts = 0;
8999 nratts = 0;
9000 nbdef = 0;
9001 nbNs = 0;
9002 nbTotalDef = 0;
9003 attval = 0;
9004
9005 if (xmlParserNsStartElement(ctxt->nsdb) < 0) {
9006 xmlErrMemory(ctxt);
9007 return(NULL);
9008 }
9009
9010 hlocalname = xmlParseQNameHashed(ctxt, &hprefix);
9011 if (hlocalname.name == NULL) {
9012 xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
9013 "StartTag: invalid element name\n");
9014 return(NULL);
9015 }
9016 localname = hlocalname.name;
9017 prefix = hprefix.name;
9018
9019 /*
9020 * Now parse the attributes, it ends up with the ending
9021 *
9022 * (S Attribute)* S?
9023 */
9024 SKIP_BLANKS;
9025 GROW;
9026
9027 /*
9028 * The ctxt->atts array will be ultimately passed to the SAX callback
9029 * containing five xmlChar pointers for each attribute:
9030 *

Callers 2

xmlParseElementStartFunction · 0.85
parser.cFile · 0.85

Calls 15

xmlParserNsStartElementFunction · 0.85
xmlErrMemoryFunction · 0.85
xmlParseQNameHashedFunction · 0.85
xmlParseAttribute2Function · 0.85
xmlStrlenFunction · 0.85
xmlDictLookupHashedFunction · 0.85
xmlParseURISafeFunction · 0.85
xmlFreeURIFunction · 0.85
xmlStrEqualFunction · 0.85
xmlParserNsPushFunction · 0.85
xmlCtxtGrowAttrsFunction · 0.85
xmlHashLookup2Function · 0.85

Tested by

no test coverage detected