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

Function xmlXPtrGetNthChild

ThirdParty/libxml2/vtklibxml2/xpointer.c:171–189  ·  view source on GitHub ↗

* xmlXPtrGetNthChild: * @cur: the node * @no: the child number * * Returns the @no'th element child of @cur or NULL */

Source from the content-addressed store, hash-verified

169 * Returns the @no'th element child of @cur or NULL
170 */
171static xmlNodePtr
172xmlXPtrGetNthChild(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/************************************************************************

Callers 4

xmlXPtrGetChildNoFunction · 0.85
xmlXPtrAdvanceCharFunction · 0.85
xmlXPtrGetLastCharFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected