* xmlTextReaderConstNamespaceUri: * @reader: the xmlTextReaderPtr used * * The URI defining the namespace associated with the node. * * Returns the namespace URI or NULL if not available, the string * will be deallocated with the reader */
| 3406 | * will be deallocated with the reader |
| 3407 | */ |
| 3408 | const xmlChar * |
| 3409 | xmlTextReaderConstNamespaceUri(xmlTextReaderPtr reader) { |
| 3410 | xmlNodePtr node; |
| 3411 | if ((reader == NULL) || (reader->node == NULL)) |
| 3412 | return(NULL); |
| 3413 | if (reader->curnode != NULL) |
| 3414 | node = reader->curnode; |
| 3415 | else |
| 3416 | node = reader->node; |
| 3417 | if (node->type == XML_NAMESPACE_DECL) |
| 3418 | return(constString(reader, BAD_CAST "http://www.w3.org/2000/xmlns/")); |
| 3419 | if ((node->type != XML_ELEMENT_NODE) && |
| 3420 | (node->type != XML_ATTRIBUTE_NODE)) |
| 3421 | return(NULL); |
| 3422 | if (node->ns != NULL) |
| 3423 | return(constString(reader, node->ns->href)); |
| 3424 | return(NULL); |
| 3425 | } |
| 3426 | |
| 3427 | /** |
| 3428 | * xmlTextReaderBaseUri: |