本文整理汇总了C#中libsbmlcs.XMLToken.setEnd方法的典型用法代码示例。如果您正苦于以下问题:C# XMLToken.setEnd方法的具体用法?C# XMLToken.setEnd怎么用?C# XMLToken.setEnd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libsbmlcs.XMLToken
的用法示例。
在下文中一共展示了XMLToken.setEnd方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
//.........这里部分代码省略.........
resource_att.add("rdf:resource",
"http://biomodels.net/biology-qualifiers/occursIn");
XMLToken predicate_token = new XMLToken(predicate_triple, resource_att);
XMLNode predicate = new XMLNode(predicate_token);
/*create the object node */
XMLTriple object_triple = new XMLTriple("object",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdf");
resource_att.clear();
resource_att.add("rdf:resource", "urn:miriam:obo.go:GO%3A0005764");
XMLToken object_token = new XMLToken(object_triple, resource_att);
XMLNode object_ = new XMLNode(object_token);
/* create the bqbiol node */
XMLTriple bqbiol_triple = new XMLTriple("isDescribedBy",
"http://biomodels.net/biology-qualifiers/",
"bqbiol");
XMLToken bqbiol_token = new XMLToken(bqbiol_triple, blank_att);
XMLNode bqbiol = new XMLNode(bqbiol_token);
/* create the bag node */
XMLTriple bag_triple = new XMLTriple("Bag",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdf");
XMLToken bag_token = new XMLToken(bag_triple, blank_att);
XMLNode bag = new XMLNode(bag_token);
/* create each li node and add to the bag */
XMLTriple li_triple = new XMLTriple("li",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdf");
resource_att.clear();
resource_att.add("rdf:resource", "urn:miriam:obo.eco:ECO%3A0000004");
XMLToken li_token = new XMLToken(li_triple, resource_att);
li_token.setEnd();
XMLNode li = new XMLNode(li_token);
bag.addChild(li);
resource_att.clear();
resource_att.add("rdf:resource", "urn:miriam:pubmed:7017716");
li_token = new XMLToken(li_triple, resource_att);
li_token.setEnd();
li = new XMLNode(li_token);
bag.addChild(li);
/* add the bag to bqbiol */
bqbiol.addChild(bag);
/* add subject, predicate, object and bqbiol to statement */
statement.addChild(subject);
statement.addChild(predicate);
statement.addChild(object_);
statement.addChild(bqbiol);
/* create a top-level RDF element
* this will ensure correct merging
*/
XMLNamespaces xmlns = new XMLNamespaces();
xmlns.add("http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdf");
xmlns.add("http://purl.org/dc/elements/1.1/", "dc");
xmlns.add("http://purl.org/dc/terms/", "dcterms");
xmlns.add("http://www.w3.org/2001/vcard-rdf/3.0#", "vCard");
xmlns.add("http://biomodels.net/biology-qualifiers/", "bqbiol");
xmlns.add("http://biomodels.net/model-qualifiers/", "bqmodel");
XMLTriple RDF_triple = new XMLTriple("RDF",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdf");
XMLToken RDF_token = new XMLToken(RDF_triple, blank_att, xmlns);
XMLNode annotation = new XMLNode(RDF_token);
/* add the staement node to the RDF node */
annotation.addChild(statement);
s.appendAnnotation(annotation);
libsbml.writeSBML(d, args[1]);
}
}
return (int)errors;
}
示例2: test_XMLToken_newSetters_setEnd
public void test_XMLToken_newSetters_setEnd()
{
XMLToken token = new XMLToken();
assertTrue( token.isEnd() == false );
int i = token.setEnd();
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( token.isEnd() == true );
i = token.unsetEnd();
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( token.isEnd() == false );
token = null;
}