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

Function xmlTextReaderLookupNamespace

ThirdParty/libxml2/vtklibxml2/xmlreader.c:2551–2569  ·  view source on GitHub ↗

* xmlTextReaderLookupNamespace: * @reader: the xmlTextReaderPtr used * @prefix: the prefix whose namespace URI is to be resolved. To return * the default namespace, specify NULL * * Resolves a namespace prefix in the scope of the current element. * * Returns a string containing the namespace URI to which the prefix maps * or NULL in case of error. The string must be deallocate

Source from the content-addressed store, hash-verified

2549 * or NULL in case of error. The string must be deallocated by the caller.
2550 */
2551xmlChar *
2552xmlTextReaderLookupNamespace(xmlTextReaderPtr reader, const xmlChar *prefix) {
2553 xmlNsPtr ns;
2554 int result;
2555
2556 if (reader == NULL)
2557 return(NULL);
2558 if (reader->node == NULL)
2559 return(NULL);
2560
2561 result = xmlSearchNsSafe(reader->node, prefix, &ns);
2562 if (result < 0) {
2563 xmlTextReaderErrMemory(reader);
2564 return(NULL);
2565 }
2566 if (ns == NULL)
2567 return(NULL);
2568 return(readerStrdup(reader, ns->href));
2569}
2570
2571/**
2572 * xmlTextReaderMoveToAttributeNo:

Callers 1

xmlSchemaLookupNamespaceFunction · 0.85

Calls 3

xmlSearchNsSafeFunction · 0.85
xmlTextReaderErrMemoryFunction · 0.85
readerStrdupFunction · 0.85

Tested by

no test coverage detected