* xmlXPathNextNamespace: * @ctxt: the XPath Parser context * @cur: the current attribute in the traversal * * Traversal function for the "namespace" direction * the namespace axis contains the namespace nodes of the context node; * the order of nodes on this axis is implementation-defined; the axis will * be empty unless the context node is an element * * We keep the XML namespace node
| 7323 | * Returns the next element following that axis |
| 7324 | */ |
| 7325 | xmlNodePtr |
| 7326 | xmlXPathNextNamespace(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { |
| 7327 | if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL); |
| 7328 | if (ctxt->context->node->type != XML_ELEMENT_NODE) return(NULL); |
| 7329 | if (cur == NULL) { |
| 7330 | if (ctxt->context->tmpNsList != NULL) |
| 7331 | xmlFree(ctxt->context->tmpNsList); |
| 7332 | ctxt->context->tmpNsNr = 0; |
| 7333 | if (xmlGetNsListSafe(ctxt->context->doc, ctxt->context->node, |
| 7334 | &ctxt->context->tmpNsList) < 0) { |
| 7335 | xmlXPathPErrMemory(ctxt); |
| 7336 | return(NULL); |
| 7337 | } |
| 7338 | if (ctxt->context->tmpNsList != NULL) { |
| 7339 | while (ctxt->context->tmpNsList[ctxt->context->tmpNsNr] != NULL) { |
| 7340 | ctxt->context->tmpNsNr++; |
| 7341 | } |
| 7342 | } |
| 7343 | return((xmlNodePtr) xmlXPathXMLNamespace); |
| 7344 | } |
| 7345 | if (ctxt->context->tmpNsNr > 0) { |
| 7346 | return (xmlNodePtr)ctxt->context->tmpNsList[--ctxt->context->tmpNsNr]; |
| 7347 | } else { |
| 7348 | if (ctxt->context->tmpNsList != NULL) |
| 7349 | xmlFree(ctxt->context->tmpNsList); |
| 7350 | ctxt->context->tmpNsList = NULL; |
| 7351 | return(NULL); |
| 7352 | } |
| 7353 | } |
| 7354 | |
| 7355 | /** |
| 7356 | * xmlXPathNextAttribute: |
nothing calls this directly
no test coverage detected