libsbml.XMLToken.removeAttr C# (CSharp) Method

removeAttr() public method

public removeAttr ( XMLTriple triple ) : int
triple XMLTriple
return int
        public int removeAttr(XMLTriple triple)
        {
            int ret = libsbmlPINVOKE.XMLToken_removeAttr__SWIG_3(swigCPtr, XMLTriple.getCPtr(triple));
            if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
            return ret;
        }

Same methods

XMLToken::removeAttr ( int n ) : int
XMLToken::removeAttr ( string name ) : int
XMLToken::removeAttr ( string name, string uri ) : int

Usage Example

コード例 #1
0
 public void test_XMLToken_newSetters_removeAttributes1()
 {
     XMLTriple triple = new  XMLTriple("test","","");
       XMLAttributes attr = new  XMLAttributes();
       XMLToken token = new  XMLToken(triple,attr);
       XMLTriple xt2 = new  XMLTriple("name3", "http://name3.org/", "p3");
       XMLTriple xt1 = new  XMLTriple("name5", "http://name5.org/", "p5");
       int i = token.addAttr( "name1", "val1");
       i = token.addAttr( "name2", "val2", "http://name1.org/", "p1");
       i = token.addAttr(xt2, "val2");
       i = token.addAttr( "name4", "val4");
       assertTrue( token.getAttributes().getLength() == 4 );
       i = token.removeAttr(7);
       assertTrue( i == libsbml.LIBSBML_INDEX_EXCEEDS_SIZE );
       i = token.removeAttr( "name7");
       assertTrue( i == libsbml.LIBSBML_INDEX_EXCEEDS_SIZE );
       i = token.removeAttr( "name7", "namespaces7");
       assertTrue( i == libsbml.LIBSBML_INDEX_EXCEEDS_SIZE );
       i = token.removeAttr(xt1);
       assertTrue( i == libsbml.LIBSBML_INDEX_EXCEEDS_SIZE );
       assertTrue( token.getAttributes().getLength() == 4 );
       i = token.removeAttr(3);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( token.getAttributes().getLength() == 3 );
       i = token.removeAttr( "name1");
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( token.getAttributes().getLength() == 2 );
       i = token.removeAttr( "name2", "http://name1.org/");
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( token.getAttributes().getLength() == 1 );
       i = token.removeAttr(xt2);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( token.getAttributes().getLength() == 0 );
       xt1 = null;
       xt2 = null;
       triple = null;
       attr = null;
       token = null;
 }
All Usage Examples Of libsbml.XMLToken::removeAttr