当前位置: 首页>>代码示例>>C#>>正文


C# XMLNode.addChild方法代码示例

本文整理汇总了C#中libsbml.XMLNode.addChild方法的典型用法代码示例。如果您正苦于以下问题:C# XMLNode.addChild方法的具体用法?C# XMLNode.addChild怎么用?C# XMLNode.addChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在libsbml.XMLNode的用法示例。


在下文中一共展示了XMLNode.addChild方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: test_Node_clone

 public void test_Node_clone()
 {
     XMLAttributes att = new XMLAttributes();
       XMLTriple t = new XMLTriple("sarah", "http://foo.org/", "bar");
       XMLToken token = new XMLToken(t,att,3,4);
       XMLNode node = new XMLNode(token);
       XMLNode child = new XMLNode();
       node.addChild(child);
       assertTrue( node.getNumChildren() == 1 );
       assertTrue( node.getName() ==  "sarah" );
       assertTrue( node.getURI() ==  "http://foo.org/" );
       assertTrue( node.getPrefix() ==  "bar" );
       assertTrue( node.isEnd() == false );
       assertTrue( node.isEOF() == false );
       assertTrue( node.getLine() == 3 );
       assertTrue( node.getColumn() == 4 );
       XMLNode node2 = (XMLNode) node.clone();
       assertTrue( node2.getNumChildren() == 1 );
       assertTrue( node2.getName() ==  "sarah" );
       assertTrue( node2.getURI() ==  "http://foo.org/" );
       assertTrue( node2.getPrefix() ==  "bar" );
       assertTrue( node2.isEnd() == false );
       assertTrue( node2.isEOF() == false );
       assertTrue( node2.getLine() == 3 );
       assertTrue( node2.getColumn() == 4 );
       t = null;
       token = null;
       node = null;
       node2 = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:30,代码来源:TestCopyAndClone.cs

示例2: test_XMLNode_addChild1

 public void test_XMLNode_addChild1()
 {
     XMLNode node = new XMLNode();
       XMLNode node2 = new XMLNode();
       int i = node.addChild(node2);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( node.getNumChildren() == 1 );
       node = null;
       node2 = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:10,代码来源:TestXMLNode_newSetters.cs

示例3: test_XMLNode_addChild3

 public void test_XMLNode_addChild3()
 {
     XMLTriple triple = new  XMLTriple("test","","");
       XMLNode node = new XMLNode(triple);
       XMLNode node2 = new XMLNode();
       int i = node.addChild(node2);
       assertTrue( i == libsbml.LIBSBML_INVALID_XML_OPERATION );
       assertTrue( node.getNumChildren() == 0 );
       triple = null;
       node = null;
       node2 = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:12,代码来源:TestXMLNode_newSetters.cs

示例4: test_XMLNode_addChild2

 public void test_XMLNode_addChild2()
 {
     XMLTriple triple = new  XMLTriple("test","","");
       XMLAttributes attr = new  XMLAttributes();
       XMLNode node = new XMLNode(triple,attr);
       XMLNode node2 = new XMLNode();
       int i = node.addChild(node2);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( node.getNumChildren() == 1 );
       triple = null;
       attr = null;
       node = null;
       node2 = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:14,代码来源:TestXMLNode_newSetters.cs

示例5: test_SyntaxChecker_validXHTML

 public void test_SyntaxChecker_validXHTML()
 {
     XMLToken token;
       XMLNode node;
       XMLTriple triple = new  XMLTriple("p", "", "");
       XMLAttributes att = new  XMLAttributes();
       XMLNamespaces ns = new  XMLNamespaces();
       ns.add( "http://www.w3.org/1999/xhtml", "");
       XMLToken tt = new  XMLToken("This is my text");
       XMLNode n1 = new XMLNode(tt);
       token = new  XMLToken(triple,att,ns);
       node = new XMLNode(token);
       node.addChild(n1);
       assertTrue( SyntaxChecker.hasExpectedXHTMLSyntax(node,null) == false );
       triple = new  XMLTriple("html", "", "");
       ns.clear();
       token = new  XMLToken(triple,att,ns);
       node = new XMLNode(token);
       node.addChild(n1);
       assertTrue( SyntaxChecker.hasExpectedXHTMLSyntax(node,null) == false );
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:21,代码来源:TestSyntaxChecker.cs

示例6: test_CVTerm_createFromNode

 public void test_CVTerm_createFromNode()
 {
     XMLAttributes xa;
       XMLTriple qual_triple = new  XMLTriple("is", "", "bqbiol");
       XMLTriple bag_triple = new  XMLTriple();
       XMLTriple li_triple = new  XMLTriple();
       XMLAttributes att = new  XMLAttributes();
       att.add( "", "This is my resource");
       XMLAttributes att1 = new  XMLAttributes();
       XMLToken li_token = new  XMLToken(li_triple,att);
       XMLToken bag_token = new  XMLToken(bag_triple,att1);
       XMLToken qual_token = new  XMLToken(qual_triple,att1);
       XMLNode li = new XMLNode(li_token);
       XMLNode bag = new XMLNode(bag_token);
       XMLNode node = new XMLNode(qual_token);
       bag.addChild(li);
       node.addChild(bag);
       CVTerm term = new  CVTerm(node);
       assertTrue( term != null );
       assertTrue( term.getQualifierType() == libsbml.BIOLOGICAL_QUALIFIER );
       assertTrue( term.getBiologicalQualifierType() == libsbml.BQB_IS );
       xa = term.getResources();
       assertTrue( xa.getLength() == 1 );
       assertTrue((  "rdf:resource" == xa.getName(0) ));
       assertTrue((  "This is my resource" == xa.getValue(0) ));
       qual_triple = null;
       bag_triple = null;
       li_triple = null;
       li_token = null;
       bag_token = null;
       qual_token = null;
       att = null;
       att1 = null;
       term = null;
       node = null;
       bag = null;
       li = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:38,代码来源:TestCVTerms.cs

示例7: test_SBase_appendNotes8

 public void test_SBase_appendNotes8()
 {
     XMLAttributes att = new  XMLAttributes();
       XMLNamespaces ns = new  XMLNamespaces();
       ns.add( "http://www.w3.org/1999/xhtml", "");
       XMLTriple body_triple = new  XMLTriple("body", "", "");
       XMLTriple p_triple = new  XMLTriple("p", "", "");
       XMLToken body_token = new  XMLToken(body_triple,att,ns);
       XMLToken p_token = new  XMLToken(p_triple,att);
       XMLToken text_token = new  XMLToken("This is my text");
       XMLNode body_node = new XMLNode(body_token);
       XMLNode p_node = new XMLNode(p_token);
       XMLNode text_node = new XMLNode(text_token);
       XMLToken p_token1 = new  XMLToken(p_triple,att,ns);
       XMLToken text_token1 = new  XMLToken("This is more text");
       XMLNode p_node1 = new XMLNode(p_token1);
       XMLNode text_node1 = new XMLNode(text_token1);
       XMLNode notes;
       XMLNode child, child1;
       p_node.addChild(text_node);
       body_node.addChild(p_node);
       p_node1.addChild(text_node1);
       S.setNotes(body_node);
       S.appendNotes(p_node1);
       notes = S.getNotes();
       assertTrue((  "notes" == notes.getName() ));
       assertTrue( notes.getNumChildren() == 1 );
       child = notes.getChild(0);
       assertTrue((  "body" == child.getName() ));
       assertTrue( child.getNumChildren() == 2 );
       child1 = child.getChild(0);
       assertTrue((  "p" == child1.getName() ));
       assertTrue( child1.getNumChildren() == 1 );
       child1 = child1.getChild(0);
       assertTrue((  "This is my text" == child1.getCharacters() ));
       assertTrue( child1.getNumChildren() == 0 );
       child1 = child.getChild(1);
       assertTrue((  "p" == child1.getName() ));
       assertTrue( child1.getNumChildren() == 1 );
       child1 = child1.getChild(0);
       assertTrue((  "This is more text" == child1.getCharacters() ));
       assertTrue( child1.getNumChildren() == 0 );
       att = null;
       ns = null;
       body_triple = null;
       p_triple = null;
       body_token = null;
       p_token = null;
       text_token = null;
       text_token1 = null;
       p_token1 = null;
       body_node = null;
       p_node = null;
       text_node = null;
       p_node1 = null;
       text_node1 = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:57,代码来源:TestSBase.cs

示例8: test_SBase_appendNotes

 public void test_SBase_appendNotes()
 {
     XMLToken token;
       XMLNode node;
       XMLToken token1;
       XMLNode node1;
       XMLNode node2;
       XMLTriple triple = new  XMLTriple("p", "", "");
       XMLAttributes att = new  XMLAttributes();
       XMLNamespaces ns = new  XMLNamespaces();
       ns.add( "http://www.w3.org/1999/xhtml", "");
       XMLToken token4 = new  XMLToken("This is my text");
       XMLNode node4 = new XMLNode(token4);
       XMLToken token5 = new  XMLToken("This is additional text");
       XMLNode node5 = new XMLNode(token5);
       token = new  XMLToken(triple,att,ns);
       node = new XMLNode(token);
       node.addChild(node4);
       S.setNotes(node);
       assertTrue( S.isSetNotes() == true );
       token1 = new  XMLToken(triple,att,ns);
       node1 = new XMLNode(token1);
       node1.addChild(node5);
       S.appendNotes(node1);
       assertTrue( S.isSetNotes() == true );
       node2 = S.getNotes();
       assertTrue( node2.getNumChildren() == 2 );
       assertTrue((  "p" == node2.getChild(0).getName() ));
       assertTrue( node2.getChild(0).getNumChildren() == 1 );
       assertTrue((  "p" == node2.getChild(1).getName() ));
       assertTrue( node2.getChild(1).getNumChildren() == 1 );
       string chars1 = node2.getChild(0).getChild(0).getCharacters();
       string chars2 = node2.getChild(1).getChild(0).getCharacters();
       assertTrue((  "This is my text" == chars1 ));
       assertTrue((  "This is additional text" == chars2 ));
       node = null;
       node1 = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:38,代码来源:TestSBase.cs

示例9: test_WriteSBML_Constraint_full

 public void test_WriteSBML_Constraint_full()
 {
     D.setLevelAndVersion(2,2,false);
       string expected = "<constraint sboTerm=\"SBO:0000064\">\n" +
     "  <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n" +
     "    <apply>\n" +
     "      <leq/>\n" +
     "      <ci> P1 </ci>\n" +
     "      <ci> t </ci>\n" +
     "    </apply>\n" +
     "  </math>\n" +
     "  <message>\n" +
     "    <p xmlns=\"http://www.w3.org/1999/xhtml\"> Species P1 is out of range </p>\n" +
     "  </message>\n" +
     "</constraint>";
       Constraint c = D.createModel().createConstraint();
       ASTNode node = libsbml.parseFormula("leq(P1,t)");
       c.setMath(node);
       c.setSBOTerm(64);
       XMLNode text = XMLNode.convertStringToXMLNode(" Species P1 is out of range ");
       XMLTriple triple = new XMLTriple("p", "http://www.w3.org/1999/xhtml", "");
       XMLAttributes att = new XMLAttributes();
       XMLNamespaces xmlns = new XMLNamespaces();
       xmlns.add("http://www.w3.org/1999/xhtml");
       XMLNode p = new XMLNode(triple,att,xmlns);
       p.addChild(text);
       XMLTriple triple1 = new XMLTriple("message", "", "");
       XMLAttributes att1 = new XMLAttributes();
       XMLNode message = new XMLNode(triple1,att1);
       message.addChild(p);
       c.setMessage(message);
       assertEquals( true, equals(expected,c.toSBML()) );
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:33,代码来源:TestWriteSBML.cs

示例10: test_SBase_setNotes3

 public void test_SBase_setNotes3()
 {
     XMLAttributes att = new  XMLAttributes();
       XMLNamespaces ns = new  XMLNamespaces();
       ns.add( "http://www.w3.org/1999/xhtml", "");
       XMLTriple p_triple = new  XMLTriple("p", "", "");
       XMLToken p_token = new  XMLToken(p_triple,att,ns);
       XMLToken text_token = new  XMLToken("This is my text");
       XMLNode p_node = new XMLNode(p_token);
       XMLNode text_node = new XMLNode(text_token);
       XMLNode notes;
       XMLNode child;
       p_node.addChild(text_node);
       int i = S.setNotes(p_node);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       notes = S.getNotes();
       assertTrue((  "notes" == notes.getName() ));
       assertTrue( notes.getNumChildren() == 1 );
       child = notes.getChild(0);
       assertTrue((  "p" == child.getName() ));
       assertTrue( child.getNumChildren() == 1 );
       child = child.getChild(0);
       assertTrue((  "This is my text" == child.getCharacters() ));
       assertTrue( child.getNumChildren() == 0 );
       att = null;
       ns = null;
       p_triple = null;
       p_token = null;
       text_token = null;
       p_node = null;
       text_node = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:32,代码来源:TestSBase_newSetters.cs

示例11: test_XMLNode_remove

 public void test_XMLNode_remove()
 {
     XMLAttributes attr = new  XMLAttributes();
       XMLTriple trp_p = new  XMLTriple("parent","","");
       XMLTriple trp_c1 = new  XMLTriple("child1","","");
       XMLTriple trp_c2 = new  XMLTriple("child2","","");
       XMLTriple trp_c3 = new  XMLTriple("child3","","");
       XMLTriple trp_c4 = new  XMLTriple("child4","","");
       XMLTriple trp_c5 = new  XMLTriple("child5","","");
       XMLNode p = new XMLNode(trp_p,attr);
       XMLNode c1 = new XMLNode(trp_c1,attr);
       XMLNode c2 = new XMLNode(trp_c2,attr);
       XMLNode c3 = new XMLNode(trp_c3,attr);
       XMLNode c4 = new XMLNode(trp_c4,attr);
       XMLNode c5 = new XMLNode(trp_c5,attr);
       XMLNode r;
       p.addChild(c1);
       p.addChild(c2);
       p.addChild(c3);
       p.addChild(c4);
       p.addChild(c5);
       r = p.removeChild(5);
       assertTrue( r == null );
       r = p.removeChild(1);
       assertTrue( p.getNumChildren() == 4 );
       assertTrue( ( "child2" != r.getName() ) == false );
       r = null;
       r = p.removeChild(3);
       assertTrue( p.getNumChildren() == 3 );
       assertTrue( ( "child5" != r.getName() ) == false );
       r = null;
       r = p.removeChild(0);
       assertTrue( p.getNumChildren() == 2 );
       assertTrue( ( "child1" != r.getName() ) == false );
       r = null;
       r = p.removeChild(1);
       assertTrue( p.getNumChildren() == 1 );
       assertTrue( ( "child4" != r.getName() ) == false );
       r = null;
       r = p.removeChild(0);
       assertTrue( p.getNumChildren() == 0 );
       assertTrue( ( "child3" != r.getName() ) == false );
       r = null;
       p.addChild(c1);
       p.addChild(c2);
       p.addChild(c3);
       p.addChild(c4);
       p.addChild(c5);
       r = p.removeChild(4);
       assertTrue( p.getNumChildren() == 4 );
       assertTrue( ( "child5" != r.getName() ) == false );
       r = null;
       r = p.removeChild(3);
       assertTrue( p.getNumChildren() == 3 );
       assertTrue( ( "child4" != r.getName() ) == false );
       r = null;
       r = p.removeChild(2);
       assertTrue( p.getNumChildren() == 2 );
       assertTrue( ( "child3" != r.getName() ) == false );
       r = null;
       r = p.removeChild(1);
       assertTrue( p.getNumChildren() == 1 );
       assertTrue( ( "child2" != r.getName() ) == false );
       r = null;
       r = p.removeChild(0);
       assertTrue( p.getNumChildren() == 0 );
       assertTrue( ( "child1" != r.getName() ) == false );
       r = null;
       p.addChild(c1);
       p.addChild(c2);
       p.addChild(c3);
       p.addChild(c4);
       p.addChild(c5);
       r = p.removeChild(0);
       assertTrue( p.getNumChildren() == 4 );
       assertTrue( ( "child1" != r.getName() ) == false );
       r = null;
       r = p.removeChild(0);
       assertTrue( p.getNumChildren() == 3 );
       assertTrue( ( "child2" != r.getName() ) == false );
       r = null;
       r = p.removeChild(0);
       assertTrue( p.getNumChildren() == 2 );
       assertTrue( ( "child3" != r.getName() ) == false );
       r = null;
       r = p.removeChild(0);
       assertTrue( p.getNumChildren() == 1 );
       assertTrue( ( "child4" != r.getName() ) == false );
       r = null;
       r = p.removeChild(0);
       assertTrue( p.getNumChildren() == 0 );
       assertTrue( ( "child5" != r.getName() ) == false );
       r = null;
       p.addChild(c1);
       p.addChild(c2);
       p.addChild(c3);
       p.addChild(c4);
       p.addChild(c5);
       r = p.removeChild(0);
       assertTrue( ( "child1" != r.getName() ) == false );
//.........这里部分代码省略.........
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:101,代码来源:TestXMLNode.cs

示例12: test_XMLNode_insert

 public void test_XMLNode_insert()
 {
     XMLAttributes attr = new  XMLAttributes();
       XMLTriple trp_p = new  XMLTriple("parent","","");
       XMLTriple trp_c1 = new  XMLTriple("child1","","");
       XMLTriple trp_c2 = new  XMLTriple("child2","","");
       XMLTriple trp_c3 = new  XMLTriple("child3","","");
       XMLTriple trp_c4 = new  XMLTriple("child4","","");
       XMLTriple trp_c5 = new  XMLTriple("child5","","");
       XMLNode p = new XMLNode(trp_p,attr);
       XMLNode c1 = new XMLNode(trp_c1,attr);
       XMLNode c2 = new XMLNode(trp_c2,attr);
       XMLNode c3 = new XMLNode(trp_c3,attr);
       XMLNode c4 = new XMLNode(trp_c4,attr);
       XMLNode c5 = new XMLNode(trp_c5,attr);
       p.addChild(c2);
       p.addChild(c4);
       p.insertChild(0,c1);
       p.insertChild(2,c3);
       p.insertChild(4,c5);
       assertTrue( p.getNumChildren() == 5 );
       assertTrue( (  "child1" != p.getChild(0).getName() ) == false );
       assertTrue( (  "child2" != p.getChild(1).getName() ) == false );
       assertTrue( (  "child3" != p.getChild(2).getName() ) == false );
       assertTrue( (  "child4" != p.getChild(3).getName() ) == false );
       assertTrue( (  "child5" != p.getChild(4).getName() ) == false );
       p.removeChildren();
       p.insertChild(0,c1);
       p.insertChild(0,c2);
       p.insertChild(0,c3);
       p.insertChild(0,c4);
       p.insertChild(0,c5);
       assertTrue( p.getNumChildren() == 5 );
       assertTrue( (  "child5" != p.getChild(0).getName() ) == false );
       assertTrue( (  "child4" != p.getChild(1).getName() ) == false );
       assertTrue( (  "child3" != p.getChild(2).getName() ) == false );
       assertTrue( (  "child2" != p.getChild(3).getName() ) == false );
       assertTrue( (  "child1" != p.getChild(4).getName() ) == false );
       p.removeChildren();
       p.insertChild(1,c1);
       p.insertChild(2,c2);
       p.insertChild(3,c3);
       p.insertChild(4,c4);
       p.insertChild(5,c5);
       assertTrue( p.getNumChildren() == 5 );
       assertTrue( (  "child1" != p.getChild(0).getName() ) == false );
       assertTrue( (  "child2" != p.getChild(1).getName() ) == false );
       assertTrue( (  "child3" != p.getChild(2).getName() ) == false );
       assertTrue( (  "child4" != p.getChild(3).getName() ) == false );
       assertTrue( (  "child5" != p.getChild(4).getName() ) == false );
       p.removeChildren();
       XMLNode tmp;
       tmp = p.insertChild(0,c1);
       assertTrue( ( "child1" != tmp.getName() ) == false );
       tmp = p.insertChild(0,c2);
       assertTrue( ( "child2" != tmp.getName() ) == false );
       tmp = p.insertChild(0,c3);
       assertTrue( ( "child3" != tmp.getName() ) == false );
       tmp = p.insertChild(0,c4);
       assertTrue( ( "child4" != tmp.getName() ) == false );
       tmp = p.insertChild(0,c5);
       assertTrue( ( "child5" != tmp.getName() ) == false );
       p.removeChildren();
       tmp = p.insertChild(1,c1);
       assertTrue( ( "child1" != tmp.getName() ) == false );
       tmp = p.insertChild(2,c2);
       assertTrue( ( "child2" != tmp.getName() ) == false );
       tmp = p.insertChild(3,c3);
       assertTrue( ( "child3" != tmp.getName() ) == false );
       tmp = p.insertChild(4,c4);
       assertTrue( ( "child4" != tmp.getName() ) == false );
       tmp = p.insertChild(5,c5);
       assertTrue( ( "child5" != tmp.getName() ) == false );
       p = null;
       c1 = null;
       c2 = null;
       c3 = null;
       c4 = null;
       c5 = null;
       attr = null;
       trp_p = null;
       trp_c1 = null;
       trp_c2 = null;
       trp_c3 = null;
       trp_c4 = null;
       trp_c5 = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:87,代码来源:TestXMLNode.cs

示例13: test_XMLNode_create

 public void test_XMLNode_create()
 {
     XMLNode node = new XMLNode();
       assertTrue( node != null );
       assertTrue( node.getNumChildren() == 0 );
       node = null;
       node = new XMLNode();
       assertTrue( node != null );
       XMLNode node2 = new XMLNode();
       assertTrue( node2 != null );
       node.addChild(node2);
       assertTrue( node.getNumChildren() == 1 );
       XMLNode node3 = new XMLNode();
       assertTrue( node3 != null );
       node.addChild(node3);
       assertTrue( node.getNumChildren() == 2 );
       node = null;
       node2 = null;
       node3 = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:20,代码来源:TestXMLNode.cs

示例14: test_Constraint_setMessage

 public void test_Constraint_setMessage()
 {
     XMLNode text = XMLNode.convertStringToXMLNode(" Some text ",null);
       XMLTriple triple = new  XMLTriple("p", "http://www.w3.org/1999/xhtml", "");
       XMLAttributes att = new  XMLAttributes();
       XMLNamespaces xmlns = new  XMLNamespaces();
       xmlns.add( "http://www.w3.org/1999/xhtml", "");
       XMLNode p = new XMLNode(triple,att,xmlns);
       p.addChild(text);
       XMLTriple triple1 = new  XMLTriple("message", "", "");
       XMLAttributes att1 = new  XMLAttributes();
       XMLNode node = new XMLNode(triple1,att1);
       node.addChild(p);
       C.setMessage(node);
       assertTrue( C.getMessage() != node );
       assertTrue( C.isSetMessage() == true );
       C.setMessage(C.getMessage());
       assertTrue( C.getMessage() != node );
       assertTrue( C.getMessageString() != null );
       C.unsetMessage();
       assertEquals( false, C.isSetMessage() );
       if (C.getMessage() != null);
       {
       }
       node = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:26,代码来源:TestConstraint.cs

示例15: test_SBase_appendNotes5

 public void test_SBase_appendNotes5()
 {
     XMLAttributes att = new  XMLAttributes();
       XMLNamespaces ns = new  XMLNamespaces();
       ns.add( "http://www.w3.org/1999/xhtml", "");
       XMLTriple html_triple = new  XMLTriple("html", "", "");
       XMLTriple head_triple = new  XMLTriple("head", "", "");
       XMLTriple title_triple = new  XMLTriple("title", "", "");
       XMLTriple body_triple = new  XMLTriple("body", "", "");
       XMLTriple p_triple = new  XMLTriple("p", "", "");
       XMLToken html_token = new  XMLToken(html_triple,att,ns);
       XMLToken head_token = new  XMLToken(head_triple,att);
       XMLToken title_token = new  XMLToken(title_triple,att);
       XMLToken body_token = new  XMLToken(body_triple,att);
       XMLToken p_token = new  XMLToken(p_triple,att);
       XMLToken p_token1 = new  XMLToken(p_triple,att,ns);
       XMLToken text_token = new  XMLToken("This is my text");
       XMLNode p_node = new XMLNode(p_token1);
       XMLNode text_node = new XMLNode(text_token);
       XMLToken text_token1 = new  XMLToken("This is more text");
       XMLNode html_node1 = new XMLNode(html_token);
       XMLNode head_node1 = new XMLNode(head_token);
       XMLNode title_node1 = new XMLNode(title_token);
       XMLNode body_node1 = new XMLNode(body_token);
       XMLNode p_node1 = new XMLNode(p_token);
       XMLNode text_node1 = new XMLNode(text_token1);
       XMLNode notes;
       XMLNode child, child1;
       p_node.addChild(text_node);
       p_node1.addChild(text_node1);
       body_node1.addChild(p_node1);
       head_node1.addChild(title_node1);
       html_node1.addChild(head_node1);
       html_node1.addChild(body_node1);
       int i = S.setNotes(p_node);
       i = S.appendNotes(html_node1);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       notes = S.getNotes();
       assertTrue((  "notes" == notes.getName() ));
       assertTrue( notes.getNumChildren() == 1 );
       child = notes.getChild(0);
       assertTrue((  "html" == child.getName() ));
       assertTrue( child.getNumChildren() == 2 );
       child = child.getChild(1);
       assertTrue((  "body" == child.getName() ));
       assertTrue( child.getNumChildren() == 2 );
       child1 = child.getChild(0);
       assertTrue((  "p" == child1.getName() ));
       assertTrue( child1.getNumChildren() == 1 );
       child1 = child1.getChild(0);
       assertTrue((  "This is my text" == child1.getCharacters() ));
       assertTrue( child1.getNumChildren() == 0 );
       child1 = child.getChild(1);
       assertTrue((  "p" == child1.getName() ));
       assertTrue( child1.getNumChildren() == 1 );
       child1 = child1.getChild(0);
       assertTrue((  "This is more text" == child1.getCharacters() ));
       assertTrue( child1.getNumChildren() == 0 );
       att = null;
       ns = null;
       html_triple = null;
       head_triple = null;
       body_triple = null;
       p_triple = null;
       body_token = null;
       p_token = null;
       p_token1 = null;
       text_token = null;
       text_token1 = null;
       p_node = null;
       text_node = null;
       html_node1 = null;
       head_node1 = null;
       body_node1 = null;
       p_node1 = null;
       text_node1 = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:77,代码来源:TestSBase_newSetters.cs


注:本文中的libsbml.XMLNode.addChild方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。