* xmlTreeLookupNsListByPrefix: * @nsList: a list of ns-structs * @prefix: the searched prefix * * Searches for a ns-decl with the given prefix in @nsList. * * Returns the ns-decl if found, NULL if not found and on * API errors. */
| 8042 | * API errors. |
| 8043 | */ |
| 8044 | static xmlNsPtr |
| 8045 | xmlTreeNSListLookupByPrefix(xmlNsPtr nsList, const xmlChar *prefix) |
| 8046 | { |
| 8047 | if (nsList == NULL) |
| 8048 | return (NULL); |
| 8049 | { |
| 8050 | xmlNsPtr ns; |
| 8051 | ns = nsList; |
| 8052 | do { |
| 8053 | if ((prefix == ns->prefix) || |
| 8054 | xmlStrEqual(prefix, ns->prefix)) { |
| 8055 | return (ns); |
| 8056 | } |
| 8057 | ns = ns->next; |
| 8058 | } while (ns != NULL); |
| 8059 | } |
| 8060 | return (NULL); |
| 8061 | } |
| 8062 | |
| 8063 | /* |
| 8064 | * |
no test coverage detected