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

Function xmlTextReaderNamespaceUri

ThirdParty/libxml2/vtklibxml2/xmlreader.c:3380–3397  ·  view source on GitHub ↗

* xmlTextReaderNamespaceUri: * @reader: the xmlTextReaderPtr used * * The URI defining the namespace associated with the node. * * Returns the namespace URI or NULL if not available, * if non NULL it need to be freed by the caller. */

Source from the content-addressed store, hash-verified

3378 * if non NULL it need to be freed by the caller.
3379 */
3380xmlChar *
3381xmlTextReaderNamespaceUri(xmlTextReaderPtr reader) {
3382 xmlNodePtr node;
3383 if ((reader == NULL) || (reader->node == NULL))
3384 return(NULL);
3385 if (reader->curnode != NULL)
3386 node = reader->curnode;
3387 else
3388 node = reader->node;
3389 if (node->type == XML_NAMESPACE_DECL)
3390 return(readerStrdup(reader, BAD_CAST "http://www.w3.org/2000/xmlns/"));
3391 if ((node->type != XML_ELEMENT_NODE) &&
3392 (node->type != XML_ATTRIBUTE_NODE))
3393 return(NULL);
3394 if (node->ns != NULL)
3395 return(readerStrdup(reader, node->ns->href));
3396 return(NULL);
3397}
3398
3399/**
3400 * xmlTextReaderConstNamespaceUri:

Callers 1

xmlSchemaVReaderWalkFunction · 0.85

Calls 1

readerStrdupFunction · 0.85

Tested by

no test coverage detected