#362 XMLNode::getChild documentation misleading for the starting index value

libSBML-5.8.0
closed
Lucian Smith
None
2014-08-15
2013-10-14
David Nickerson
No

The documentation for XMLNode::getChild (http://sbml.org/Software/libSBML/docs/cpp-api/class_x_m_l_node.html#a02d5d8c64c480eacf80941ad851deacd) states:

If the index n is greater than the number of child nodes, or it is 0 or less, this method returns an empty node.

Implying that the index should start at 1 for the first child, but in fact it starts at 0 - as demonstrated in various examples. The documentation should be updated to state "less than 0".

Discussion

  • Frank Bergmann
    Frank Bergmann
    2015-01-20

    NOTICE NOTICE NOTICE
    The comments associated with this ticket were lost in late 2014.
    The SBML Team manually recovered the comments. The text is appended below.
    NOTICE NOTICE NOTICE


    Comment By: Lucian Smith (luciansmith)
    Date: 2013-10-14 20:43

    Thanks for the catch! I was in the middle of updating the documentation anyway, so went ahead and fixed the documentation. And actually, as the argument is an unsigned long, it is impossible to pass this function a negative value, so I removed the '0 or less' clause entirely.

    The corrected version should be released in version 5.9.0.