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

Function xmlXPathNsLookup

ThirdParty/libxml2/vtklibxml2/xpath.c:4254–4275  ·  view source on GitHub ↗

* xmlXPathNsLookup: * @ctxt: the XPath context * @prefix: the namespace prefix value * * Search in the namespace declaration array of the context for the given * namespace name associated to the given prefix * * Returns the value or NULL if not found */

Source from the content-addressed store, hash-verified

4252 * Returns the value or NULL if not found
4253 */
4254const xmlChar *
4255xmlXPathNsLookup(xmlXPathContextPtr ctxt, const xmlChar *prefix) {
4256 if (ctxt == NULL)
4257 return(NULL);
4258 if (prefix == NULL)
4259 return(NULL);
4260
4261 if (xmlStrEqual(prefix, (const xmlChar *) "xml"))
4262 return(XML_XML_NAMESPACE);
4263
4264 if (ctxt->namespaces != NULL) {
4265 int i;
4266
4267 for (i = 0;i < ctxt->nsNr;i++) {
4268 if ((ctxt->namespaces[i] != NULL) &&
4269 (xmlStrEqual(ctxt->namespaces[i]->prefix, prefix)))
4270 return(ctxt->namespaces[i]->href);
4271 }
4272 }
4273
4274 return((const xmlChar *) xmlHashLookup(ctxt->nsHash, prefix));
4275}
4276
4277/**
4278 * xmlXPathRegisteredNsCleanup:

Callers 4

xmlXPathCompNodeTestFunction · 0.85
xmlXPathCompStepFunction · 0.85
xmlXPathCompOpEvalFunction · 0.85

Calls 2

xmlStrEqualFunction · 0.85
xmlHashLookupFunction · 0.85

Tested by

no test coverage detected