本文整理匯總了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;
}