libsbmlcs.XMLNode.getIndex C# (CSharp) Method

getIndex() public method

public getIndex ( string name ) : int
name string
return int
        public int getIndex(string name)
        {
            int ret = libsbmlPINVOKE.XMLNode_getIndex(swigCPtr, name);
            if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
            return ret;
        }

Usage Example

 public void test_XMLNode_getIndex()
 {
     string xmlstr = "<annotation>\n" + "  <test xmlns=\"http://test.org/\" id=\"test\">test</test>\n" + "</annotation>";
       XMLNode node = new XMLNode();
       assertTrue( node.getIndex( "test") == -1 );
       node = null;
       node = XMLNode.convertStringToXMLNode(xmlstr,null);
       assertTrue( node.getIndex( "test") == 0 );
       node = null;
 }