* xmlTextReaderDepth: * @reader: the xmlTextReaderPtr used * * The depth of the node in the tree. * * Returns the depth or -1 in case of error */
| 3483 | * Returns the depth or -1 in case of error |
| 3484 | */ |
| 3485 | int |
| 3486 | xmlTextReaderDepth(xmlTextReaderPtr reader) { |
| 3487 | if (reader == NULL) |
| 3488 | return(-1); |
| 3489 | if (reader->node == NULL) |
| 3490 | return(0); |
| 3491 | |
| 3492 | if (reader->curnode != NULL) { |
| 3493 | if ((reader->curnode->type == XML_ATTRIBUTE_NODE) || |
| 3494 | (reader->curnode->type == XML_NAMESPACE_DECL)) |
| 3495 | return(reader->depth + 1); |
| 3496 | return(reader->depth + 2); |
| 3497 | } |
| 3498 | return(reader->depth); |
| 3499 | } |
| 3500 | |
| 3501 | /** |
| 3502 | * xmlTextReaderHasAttributes: |
no outgoing calls