* xmlXPtrEvalXPointer: * @ctxt: the XPointer Parser context * * XPointer ::= Name * | ChildSeq * | FullXPtr * * Parse and evaluate an XPointer */
| 1224 | * Parse and evaluate an XPointer |
| 1225 | */ |
| 1226 | static void |
| 1227 | xmlXPtrEvalXPointer(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 | /************************************************************************ |
no test coverage detected