本文整理汇总了C#中libsbmlcs.XMLNamespaces.@add方法的典型用法代码示例。如果您正苦于以下问题:C# XMLNamespaces.@add方法的具体用法?C# XMLNamespaces.@add怎么用?C# XMLNamespaces.@add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libsbmlcs.XMLNamespaces
的用法示例。
在下文中一共展示了XMLNamespaces.@add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: test_SBase_appendNotes8
public void test_SBase_appendNotes8()
{
XMLAttributes att = new XMLAttributes ();
XMLNamespaces ns = new XMLNamespaces ();
[email protected] ("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;
}
示例2: test_SBase_hasValidLevelVersionNamespaceCombination
public void test_SBase_hasValidLevelVersionNamespaceCombination()
{
Species species = new Species (3, 1);
assertTrue (species.hasValidLevelVersionNamespaceCombination () == true);
species = null;
XMLNamespaces invalidNamespaces = new XMLNamespaces ();
species = new Species (3, 1);
species.setNamespaces (invalidNamespaces);
[email protected] (SBMLNamespaces.getSBMLNamespaceURI (2, 3), "sbml23");
species.setNamespaces (invalidNamespaces);
assertTrue (species.hasValidLevelVersionNamespaceCombination () == false);
[email protected] (SBMLNamespaces.getSBMLNamespaceURI (3, 1), "sbml31");
species.setNamespaces (invalidNamespaces);
assertTrue (species.hasValidLevelVersionNamespaceCombination () == false);
invalidNamespaces.clear ();
[email protected] (SBMLNamespaces.getSBMLNamespaceURI (3, 1), "sbml31");
species.setNamespaces (invalidNamespaces);
assertTrue (species.hasValidLevelVersionNamespaceCombination () == true);
species = null;
}
示例3: 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 ();
[email protected] ("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;
}