* xmlXPtrGetNthChild: * @cur: the node * @no: the child number * * Returns the @no'th element child of @cur or NULL */
| 169 | * Returns the @no'th element child of @cur or NULL |
| 170 | */ |
| 171 | static xmlNodePtr |
| 172 | xmlXPtrGetNthChild(xmlNodePtr cur, int no) { |
| 173 | int i; |
| 174 | if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) |
| 175 | return(cur); |
| 176 | cur = cur->children; |
| 177 | for (i = 0;i <= no;cur = cur->next) { |
| 178 | if (cur == NULL) |
| 179 | return(cur); |
| 180 | if ((cur->type == XML_ELEMENT_NODE) || |
| 181 | (cur->type == XML_DOCUMENT_NODE) || |
| 182 | (cur->type == XML_HTML_DOCUMENT_NODE)) { |
| 183 | i++; |
| 184 | if (i == no) |
| 185 | break; |
| 186 | } |
| 187 | } |
| 188 | return(cur); |
| 189 | } |
| 190 | |
| 191 | #ifdef LIBXML_XPTR_LOCS_ENABLED |
| 192 | /************************************************************************ |
no outgoing calls
no test coverage detected