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

Function xmlXPtrEvalXPointer

ThirdParty/libxml2/vtklibxml2/xpointer.c:1226–1262  ·  view source on GitHub ↗

* xmlXPtrEvalXPointer: * @ctxt: the XPointer Parser context * * XPointer ::= Name * | ChildSeq * | FullXPtr * * Parse and evaluate an XPointer */

Source from the content-addressed store, hash-verified

1224 * Parse and evaluate an XPointer
1225 */
1226static void
1227xmlXPtrEvalXPointer(xmlXPathParserContextPtr ctxt) {
1228 if (ctxt->valueTab == NULL) {
1229 /* Allocate the value stack */
1230 ctxt->valueTab = (xmlXPathObjectPtr *)
1231 xmlMalloc(10 * sizeof(xmlXPathObjectPtr));
1232 if (ctxt->valueTab == NULL) {
1233 xmlXPathPErrMemory(ctxt);
1234 return;
1235 }
1236 ctxt->valueNr = 0;
1237 ctxt->valueMax = 10;
1238 ctxt->value = NULL;
1239 }
1240 SKIP_BLANKS;
1241 if (CUR == '/') {
1242 xmlXPathRoot(ctxt);
1243 xmlXPtrEvalChildSeq(ctxt, NULL);
1244 } else {
1245 xmlChar *name;
1246
1247 name = xmlXPathParseName(ctxt);
1248 if (name == NULL)
1249 XP_ERROR(XPATH_EXPR_ERROR);
1250 if (CUR == '(') {
1251 xmlXPtrEvalFullXPtr(ctxt, name);
1252 /* Short evaluation */
1253 return;
1254 } else {
1255 /* this handle both Bare Names and Child Sequences */
1256 xmlXPtrEvalChildSeq(ctxt, name);
1257 }
1258 }
1259 SKIP_BLANKS;
1260 if (CUR != 0)
1261 XP_ERROR(XPATH_EXPR_ERROR);
1262}
1263
1264
1265/************************************************************************

Callers 1

xmlXPtrEvalFunction · 0.85

Calls 5

xmlXPathPErrMemoryFunction · 0.85
xmlXPathRootFunction · 0.85
xmlXPtrEvalChildSeqFunction · 0.85
xmlXPathParseNameFunction · 0.85
xmlXPtrEvalFullXPtrFunction · 0.85

Tested by

no test coverage detected