本文整理汇总了C#中libsbmlcs.XMLAttributes类的典型用法代码示例。如果您正苦于以下问题:C# XMLAttributes类的具体用法?C# XMLAttributes怎么用?C# XMLAttributes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XMLAttributes类属于libsbmlcs命名空间,在下文中一共展示了XMLAttributes类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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:0u812,项目名称:roadrunner-backup,代码行数:30,代码来源:TestCopyAndClone.cs
示例2: test_XMLNode_clearAttributes
public void test_XMLNode_clearAttributes()
{
XMLTriple triple = new XMLTriple("test","","");
XMLAttributes attr = new XMLAttributes();
XMLNode node = new XMLNode(triple,attr);
XMLTriple xt2 = new XMLTriple("name3", "http://name3.org/", "p3");
XMLTriple xt1 = new XMLTriple("name5", "http://name5.org/", "p5");
int i = node.addAttr( "name1", "val1");
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( node.getAttributes().getLength() == 1 );
i = node.addAttr( "name2", "val2", "http://name1.org/", "p1");
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( node.getAttributes().getLength() == 2 );
i = node.addAttr(xt2, "val2");
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( node.getAttributes().getLength() == 3 );
i = node.addAttr( "name4", "val4");
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( node.getAttributes().getLength() == 4 );
i = node.clearAttributes();
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( node.getAttributes().getLength() == 0 );
xt1 = null;
xt2 = null;
triple = null;
attr = null;
node = null;
}
开发者ID:0u812,项目名称:roadrunner-backup,代码行数:28,代码来源:TestXMLNode_newSetters.cs
示例3: test_XMLToken_newSetters_addAttributes1
public void test_XMLToken_newSetters_addAttributes1()
{
XMLTriple triple = new XMLTriple("test","","");
XMLAttributes attr = new XMLAttributes();
XMLToken token = new XMLToken(triple,attr);
XMLTriple xt2 = new XMLTriple("name3", "http://name3.org/", "p3");
int i = token.addAttr( "name1", "val1");
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( token.getAttributesLength() == 1 );
assertTrue( token.isAttributesEmpty() == false );
assertTrue( ( "name1" != token.getAttrName(0) ) == false );
assertTrue( ( "val1" != token.getAttrValue(0) ) == false );
i = token.addAttr( "name2", "val2", "http://name1.org/", "p1");
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( token.getAttributesLength() == 2 );
assertTrue( token.isAttributesEmpty() == false );
assertTrue( ( "name2" != token.getAttrName(1) ) == false );
assertTrue( ( "val2" != token.getAttrValue(1) ) == false );
assertTrue( ( "http://name1.org/" != token.getAttrURI(1) ) == false );
assertTrue( ( "p1" != token.getAttrPrefix(1) ) == false );
i = token.addAttr(xt2, "val2");
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( token.getAttributesLength() == 3 );
assertTrue( token.isAttributesEmpty() == false );
assertTrue( ( "name3" != token.getAttrName(2) ) == false );
assertTrue( ( "val2" != token.getAttrValue(2) ) == false );
assertTrue( ( "http://name3.org/" != token.getAttrURI(2) ) == false );
assertTrue( ( "p3" != token.getAttrPrefix(2) ) == false );
xt2 = null;
triple = null;
attr = null;
token = null;
}
开发者ID:yarden,项目名称:roadrunner,代码行数:33,代码来源:TestXMLToken_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:0u812,项目名称:roadrunner-backup,代码行数:14,代码来源:TestXMLNode_newSetters.cs
示例5: test_XMLAttributes_add1
public void test_XMLAttributes_add1()
{
XMLAttributes xa = new XMLAttributes();
XMLTriple xt2 = new XMLTriple("name2", "http://name2.org/", "p2");
int i = xa.add( "name1", "val1", "http://name1.org/", "p1");
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
i = xa.add(xt2, "val2");
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( xa.getLength() == 2 );
assertTrue( xa.isEmpty() == false );
i = xa.add( "noprefix", "val3");
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( xa.getLength() == 3 );
assertTrue( xa.isEmpty() == false );
xa = null;
xt2 = null;
}
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:17,代码来源:TestXMLAttributesC.cs
示例6: test_XMLAttributes_clone
public void test_XMLAttributes_clone()
{
XMLAttributes att1 = new XMLAttributes();
att1.add("xmlns", "http://foo.org/");
assertTrue( att1.getLength() == 1 );
assertTrue( att1.isEmpty() == false );
assertTrue( att1.getIndex("xmlns") == 0 );
assertTrue( att1.getName(0) == "xmlns" );
assertTrue( att1.getValue("xmlns") == "http://foo.org/" );
XMLAttributes att2 = (XMLAttributes) att1.clone();
assertTrue( att2.getLength() == 1 );
assertTrue( att2.isEmpty() == false );
assertTrue( att2.getIndex("xmlns") == 0 );
assertTrue( att2.getName(0) == "xmlns" );
assertTrue( att2.getValue("xmlns") == "http://foo.org/" );
att2 = null;
att1 = null;
}
开发者ID:,项目名称:,代码行数:18,代码来源:
示例7: test_SyntaxChecker_validXHTML
public void test_SyntaxChecker_validXHTML()
{
SBMLNamespaces NS24 = new SBMLNamespaces(2,4);
SBMLNamespaces NS31 = new SBMLNamespaces(3,1);
XMLToken toptoken;
XMLNode topnode;
XMLTriple toptriple = new XMLTriple("notes", "", "");
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);
toptoken = new XMLToken(toptriple,att);
topnode = new XMLNode(toptoken);
token = new XMLToken(triple,att,ns);
node = new XMLNode(token);
node.addChild(n1);
topnode.addChild(node);
assertTrue( SyntaxChecker.hasExpectedXHTMLSyntax(topnode,null) == true );
assertTrue( SyntaxChecker.hasExpectedXHTMLSyntax(topnode,NS24) == true );
assertTrue( SyntaxChecker.hasExpectedXHTMLSyntax(topnode,NS31) == true );
triple = new XMLTriple("html", "", "");
token = new XMLToken(triple,att,ns);
node = new XMLNode(token);
node.addChild(n1);
topnode.removeChild(0);
topnode.addChild(node);
assertTrue( SyntaxChecker.hasExpectedXHTMLSyntax(topnode,null) == true );
assertTrue( SyntaxChecker.hasExpectedXHTMLSyntax(topnode,NS24) == false );
assertTrue( SyntaxChecker.hasExpectedXHTMLSyntax(topnode,NS31) == true );
triple = new XMLTriple("html", "", "");
ns.clear();
token = new XMLToken(triple,att,ns);
node = new XMLNode(token);
node.addChild(n1);
topnode.removeChild(0);
topnode.addChild(node);
assertTrue( SyntaxChecker.hasExpectedXHTMLSyntax(topnode,null) == false );
assertTrue( SyntaxChecker.hasExpectedXHTMLSyntax(topnode,NS24) == false );
assertTrue( SyntaxChecker.hasExpectedXHTMLSyntax(topnode,NS31) == false );
}
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:44,代码来源:TestSyntaxChecker.cs
示例8: test_XMLAttributes_add_get
public void test_XMLAttributes_add_get()
{
XMLAttributes attrs = new XMLAttributes();
assertTrue( attrs.getLength() == 0 );
assertEquals( true, attrs.isEmpty() );
attrs.add("xmlns", "http://foo.org/");
assertTrue( attrs.getLength() == 1 );
assertTrue( attrs.isEmpty() == false );
attrs.add("foo", "bar");
assertTrue( attrs.getLength() == 2 );
assertTrue( attrs.isEmpty() == false );
assertTrue( attrs.getIndex("xmlns") == 0 );
assertTrue( attrs.getIndex("foo" ) == 1 );
assertTrue( attrs.getIndex("bar" ) == -1 );
assertTrue( attrs.getValue("xmlns") == "http://foo.org/" );
assertTrue( attrs.getValue("foo" ) == "bar" );
assertTrue( attrs.getValue("bar" ) == "" );
assertTrue( attrs.getName(0) == "xmlns" );
assertTrue( attrs.getName(1) == "foo" );
assertTrue( attrs.getName(2) == "" );
}
开发者ID:,项目名称:,代码行数:21,代码来源:
示例9: 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:0u812,项目名称:roadrunner-backup,代码行数:38,代码来源:TestCVTerms.cs
示例10: test_SBase_appendAnnotationString
public void test_SBase_appendAnnotationString()
{
XMLToken token;
XMLNode node;
token = new XMLToken("This is a test note");
node = new XMLNode(token);
XMLToken token_top;
XMLNode node_top;
XMLTriple triple = new XMLTriple("any", "", "pr");
XMLAttributes att = new XMLAttributes();
XMLNamespaces ns = new XMLNamespaces();
ns.add("http://www.any", "pr");
token_top = new XMLToken(triple, att, ns);
node_top = new XMLNode(token_top);
node_top.addChild(node);
int i = S.setAnnotation(node_top);
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
i = S.appendAnnotation("<prA:other xmlns:prA=\"http://some\">This is additional</prA:other>");
XMLNode t1 = S.getAnnotation();
assertTrue( t1.getNumChildren() == 2 );
assertTrue(( "This is a test note" == t1.getChild(0).getChild(0).getCharacters() ));
XMLNode c1 = t1.getChild(1);
assertTrue( c1.getNumChildren() == 1 );
assertTrue(( "This is additional" == c1.getChild(0).getCharacters() ));
}
开发者ID:sys-bio,项目名称:libroadrunner-deps,代码行数:25,代码来源:TestSBase_newSetters.cs
示例11: test_SBase_setNotes1
public void test_SBase_setNotes1()
{
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 text_token = new XMLToken("This is my text");
XMLNode html_node = new XMLNode(html_token);
XMLNode head_node = new XMLNode(head_token);
XMLNode title_node = new XMLNode(title_token);
XMLNode body_node = new XMLNode(body_token);
XMLNode p_node = new XMLNode(p_token);
XMLNode text_node = new XMLNode(text_token);
XMLNode notes;
XMLNode child;
p_node.addChild(text_node);
body_node.addChild(p_node);
head_node.addChild(title_node);
html_node.addChild(head_node);
html_node.addChild(body_node);
int i = S.setNotes(html_node);
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() == 1 );
child = child.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;
html_triple = null;
head_triple = null;
body_triple = null;
p_triple = null;
html_token = null;
head_token = null;
body_token = null;
p_token = null;
text_token = null;
html_node = null;
head_node = null;
body_node = null;
p_node = null;
text_node = null;
}
开发者ID:sys-bio,项目名称:libroadrunner-deps,代码行数:63,代码来源:TestSBase_newSetters.cs
示例12: Main
public static int Main(string[] args)
{
if (args.Length != 2)
{
Console.WriteLine(" usage: addingEvidenceCodes_2 <input-filename> <output-filename>");
Console.WriteLine(" Adds controlled vocabulary term to a species");
Console.WriteLine();
return 2;
}
SBMLDocument d = libsbml.readSBML(args[0]);
long errors = d.getNumErrors();
if (errors > 0)
{
Console.WriteLine("Read Error(s):");
d.printErrors();
Console.WriteLine("Correct the above and re-run.");
}
else
{
long n = d.getModel().getNumSpecies();
if (n <= 0)
{
Console.WriteLine("Model has no species.\n Cannot add CV terms\n");
}
else
{
Species s = d.getModel().getSpecies(0);
/* check that the species has a metaid
* no CVTerms will be added if there is no metaid to reference
*/
if (!s.isSetMetaId())
s.setMetaId("metaid_0000052");
CVTerm cv1 = new CVTerm(libsbml.BIOLOGICAL_QUALIFIER);
cv1.setBiologicalQualifierType(libsbml.BQB_OCCURS_IN);
cv1.addResource("urn:miriam:obo.go:GO%3A0005764");
s.addCVTerm(cv1);
// now create the additional annotation
//<rdf:Statement>
// <rdf:subject rdf:resource="#metaid_0000052"/>
// <rdf:predicate rdf:resource="http://biomodels.net/biology-qualifiers/occursIn"/>
// <rdf:object rdf:resource="urn:miriam:obo.go:GO%3A0005764"/>
// <bqbiol:isDescribedBy>
// <rdf:Bag>
// <rdf:li rdf:resource="urn:miriam:obo.eco:ECO%3A0000004"/>
// <rdf:li rdf:resource="urn:miriam:pubmed:7017716"/>
// </rdf:Bag>
// </bqbiol:isDescribedBy>
//</rdf:Statement>
/* attributes */
XMLAttributes blank_att = new XMLAttributes();
XMLAttributes resource_att = new XMLAttributes();
/* create the outer statement node */
XMLTriple statement_triple = new XMLTriple("Statement",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdf");
XMLToken statement_token = new XMLToken(statement_triple, blank_att);
XMLNode statement = new XMLNode(statement_token);
/*create the subject node */
XMLTriple subject_triple = new XMLTriple("subject",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdf");
resource_att.clear();
resource_att.add("rdf:resource", "#" + s.getMetaId());
XMLToken subject_token = new XMLToken(subject_triple, resource_att);
XMLNode subject = new XMLNode(subject_token);
/*create the predicate node */
XMLTriple predicate_triple = new XMLTriple("predicate",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdf");
resource_att.clear();
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#",
//.........这里部分代码省略.........
开发者ID:TotteKarlsson,项目名称:roadrunner,代码行数:101,代码来源:addingEvidenceCodes_2.cs
示例13: readAttributes
/** */
/* libsbml-internal */
public new bool readAttributes(XMLAttributes attributes, SWIGTYPE_p_ExpectedAttributes expectedAttributes, XMLInputStream stream, XMLToken element)
{
bool ret = libsbmlPINVOKE.ASTBase_readAttributes(swigCPtr, XMLAttributes.getCPtr(attributes), SWIGTYPE_p_ExpectedAttributes.getCPtr(expectedAttributes), XMLInputStream.getCPtr(stream), XMLToken.getCPtr(element));
if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
开发者ID:sys-bio,项目名称:libroadrunner-deps,代码行数:8,代码来源:ASTBase.cs
示例14: test_SBase_appendAnnotation
public void test_SBase_appendAnnotation()
{
XMLToken token;
XMLNode node;
XMLToken token1;
XMLNode node1;
XMLToken token_top;
XMLNode node_top;
XMLTriple triple = new XMLTriple("any", "", "pr");
XMLAttributes att = new XMLAttributes();
XMLNamespaces ns = new XMLNamespaces();
ns.add("http://www.any", "pr");
XMLToken token_top1;
XMLNode node_top1;
XMLTriple triple1 = new XMLTriple("anyOther", "", "prOther");
XMLNamespaces ns1 = new XMLNamespaces();
ns1.add("http://www.any.other", "prOther");
token = new XMLToken("This is a test note");
node = new XMLNode(token);
token1 = new XMLToken("This is additional");
node1 = new XMLNode(token1);
token_top = new XMLToken(triple, att, ns);
node_top = new XMLNode(token_top);
node_top.addChild(node);
token_top1 = new XMLToken(triple1, att, ns1);
node_top1 = new XMLNode(token_top1);
node_top1.addChild(node1);
int i = S.setAnnotation(node_top);
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
i = S.appendAnnotation(node_top1);
XMLNode t1 = S.getAnnotation();
assertTrue( t1.getNumChildren() == 2 );
assertTrue(( "This is a test note" == t1.getChild(0).getChild(0).getCharacters() ));
assertTrue(( "This is additional" == t1.getChild(1).getChild(0).getCharacters() ));
}
开发者ID:sys-bio,项目名称:libroadrunner-deps,代码行数:35,代码来源:TestSBase_newSetters.cs
示例15: XMLAttributes
/**
* Copy constructor; creates a copy of this XMLAttributes object.
*
* @p orig the XMLAttributes object to copy.
*/
public XMLAttributes(XMLAttributes orig)
: this(libsbmlPINVOKE.new_XMLAttributes__SWIG_1(XMLAttributes.getCPtr(orig)), true)
{
if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
}
开发者ID:sys-bio,项目名称:libroadrunner-deps,代码行数:10,代码来源:XMLAttributes.cs
示例16: XMLNode
/**
* Creates a new start element XMLNode with the given set of attributes and
* namespace declarations.
*
* @param triple XMLTriple.
* @param attributes XMLAttributes, the attributes to set.
* @param namespaces XMLNamespaces, the namespaces to set.
* @param line a long integer, the line number (default = 0).
* @param column a long integer, the column number (default = 0).
*
* @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif
*/
public XMLNode(XMLTriple triple, XMLAttributes attributes, XMLNamespaces namespaces, long line)
: this(libsbmlPINVOKE.new_XMLNode__SWIG_3(XMLTriple.getCPtr(triple), XMLAttributes.getCPtr(attributes), XMLNamespaces.getCPtr(namespaces), line), true)
{
if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
}
开发者ID:kirichoi,项目名称:roadrunner,代码行数:17,代码来源:XMLNode.cs
示例17: getAttributes
/**
* Returns the attributes of this element.
*
* @return the XMLAttributes of this XML element.
*/
public XMLAttributes getAttributes()
{
XMLAttributes ret = new XMLAttributes(libsbmlPINVOKE.XMLToken_getAttributes(swigCPtr), false);
return ret;
}
开发者ID:kirichoi,项目名称:roadrunner,代码行数:10,代码来源:XMLToken.cs
示例18: test_XMLToken_newSetters_setAttributes2
public void test_XMLToken_newSetters_setAttributes2()
{
int i ;
XMLTriple triple = new XMLTriple("test","","");
XMLToken token = new XMLToken(triple);
XMLAttributes nattr = new XMLAttributes();
XMLTriple xt1 = new XMLTriple("name1", "http://name1.org/", "p1");
nattr.add(xt1, "val1");
i = token.setAttributes(nattr);
assertTrue( i == libsbml.LIBSBML_INVALID_XML_OPERATION );
assertTrue( token.isAttributesEmpty() == true );
nattr = null;
triple = null;
token = null;
xt1 = null;
}
开发者ID:yarden,项目名称:roadrunner,代码行数:16,代码来源:TestXMLToken_newSetters.cs
示例19: 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);
int i = S.setNotes(node);
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( S.isSetNotes() == true );
token1 = new XMLToken(triple,att,ns);
node1 = new XMLNode(token1);
node1.addChild(node5);
i = S.appendNotes(node1);
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
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:sys-bio,项目名称:libroadrunner-deps,代码行数:40,代码来源:TestSBase_newSetters.cs
示例20: test_XMLToken_newSetters_setAttributes1
public void test_XMLToken_newSetters_setAttributes1()
{
XMLTriple triple = new XMLTriple("test","","");
XMLAttributes attr = new XMLAttributes();
XMLToken token = new XMLToken(triple,attr);
XMLAttributes nattr = new XMLAttributes();
XMLTriple xt1 = new XMLTriple("name1", "http://name1.org/", "p1");
nattr.add(xt1, "val1");
int i = token.setAttributes(nattr);
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( token.isAttributesEmpty() == false );
nattr = null;
attr = null;
triple = null;
token = null;
xt1 = null;
}
开发者ID:yarden,项目名称:roadrunner,代码行数:17,代码来源:TestXMLToken_newSetters.cs
注:本文中的libsbmlcs.XMLAttributes类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论