* xmlTextReaderMoveToNextAttribute: * @reader: the xmlTextReaderPtr used * * Moves the position of the current instance to the next attribute * associated with the current node. * * Returns 1 in case of success, -1 in case of error, 0 if not found */
| 2821 | * Returns 1 in case of success, -1 in case of error, 0 if not found |
| 2822 | */ |
| 2823 | int |
| 2824 | xmlTextReaderMoveToNextAttribute(xmlTextReaderPtr reader) { |
| 2825 | if (reader == NULL) |
| 2826 | return(-1); |
| 2827 | if (reader->node == NULL) |
| 2828 | return(-1); |
| 2829 | if (reader->node->type != XML_ELEMENT_NODE) |
| 2830 | return(0); |
| 2831 | if (reader->curnode == NULL) |
| 2832 | return(xmlTextReaderMoveToFirstAttribute(reader)); |
| 2833 | |
| 2834 | if (reader->curnode->type == XML_NAMESPACE_DECL) { |
| 2835 | xmlNsPtr ns = (xmlNsPtr) reader->curnode; |
| 2836 | if (ns->next != NULL) { |
| 2837 | reader->curnode = (xmlNodePtr) ns->next; |
| 2838 | return(1); |
| 2839 | } |
| 2840 | if (reader->node->properties != NULL) { |
| 2841 | reader->curnode = (xmlNodePtr) reader->node->properties; |
| 2842 | return(1); |
| 2843 | } |
| 2844 | return(0); |
| 2845 | } else if ((reader->curnode->type == XML_ATTRIBUTE_NODE) && |
| 2846 | (reader->curnode->next != NULL)) { |
| 2847 | reader->curnode = reader->curnode->next; |
| 2848 | return(1); |
| 2849 | } |
| 2850 | return(0); |
| 2851 | } |
| 2852 | |
| 2853 | /** |
| 2854 | * xmlTextReaderMoveToElement: |
no test coverage detected