* xmlXPathVariableLookupNS: * @ctxt: the XPath context * @name: the variable name * @ns_uri: the variable namespace URI * * Search in the Variable array of the context for the given * variable value. * * Returns the a copy of the value or NULL if not found */
| 4157 | * Returns the a copy of the value or NULL if not found |
| 4158 | */ |
| 4159 | xmlXPathObjectPtr |
| 4160 | xmlXPathVariableLookupNS(xmlXPathContextPtr ctxt, const xmlChar *name, |
| 4161 | const xmlChar *ns_uri) { |
| 4162 | if (ctxt == NULL) |
| 4163 | return(NULL); |
| 4164 | |
| 4165 | if (ctxt->varLookupFunc != NULL) { |
| 4166 | xmlXPathObjectPtr ret; |
| 4167 | |
| 4168 | ret = ((xmlXPathVariableLookupFunc)ctxt->varLookupFunc) |
| 4169 | (ctxt->varLookupData, name, ns_uri); |
| 4170 | if (ret != NULL) return(ret); |
| 4171 | } |
| 4172 | |
| 4173 | if (ctxt->varHash == NULL) |
| 4174 | return(NULL); |
| 4175 | if (name == NULL) |
| 4176 | return(NULL); |
| 4177 | |
| 4178 | return(xmlXPathObjectCopy(xmlHashLookup2(ctxt->varHash, name, ns_uri))); |
| 4179 | } |
| 4180 | |
| 4181 | /** |
| 4182 | * xmlXPathRegisteredVariablesCleanup: |
no test coverage detected