本文整理汇总了C#中libsbml.XMLAttributes类的典型用法代码示例。如果您正苦于以下问题:C# XMLAttributes类的具体用法?C# XMLAttributes怎么用?C# XMLAttributes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XMLAttributes类属于libsbml命名空间,在下文中一共展示了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:mgaldzic,项目名称:copasi_api,代码行数:30,代码来源:TestCopyAndClone.cs
示例2: 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:mgaldzic,项目名称:copasi_api,代码行数:33,代码来源:TestXMLToken_newSetters.cs
示例3: 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:mgaldzic,项目名称:copasi_api,代码行数:28,代码来源: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_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:mgaldzic,项目名称:copasi_api,代码行数:17,代码来源:TestXMLAttributesC.cs
示例6: test_XMLAttributes_assignment
public void test_XMLAttributes_assignment()
{
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 = new XMLAttributes();
att2 = att1;
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:mgaldzic,项目名称:copasi_api,代码行数:19,代码来源:TestXMLAttributes.cs
示例7: 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:mgaldzic,项目名称:copasi_api,代码行数:21,代码来源:TestXMLAttributes.cs
示例8: 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
示例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:mgaldzic,项目名称:copasi_api,代码行数:38,代码来源:TestCVTerms.cs
示例10: test_XMLAttributes_remove1
public void test_XMLAttributes_remove1()
{
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 );
i = xa.add( "noprefix", "val3");
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
i = xa.add( "name4", "val4", "http://name4.org/", "p1");
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( xa.getLength() == 4 );
i = xa.remove(4);
assertTrue( i == libsbml.LIBSBML_INDEX_EXCEEDS_SIZE );
i = xa.remove(3);
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( xa.getLength() == 3 );
i = xa.remove( "noprefix");
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( xa.getLength() == 2 );
i = xa.remove(xt2);
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( xa.getLength() == 1 );
i = xa.remove( "name1", "http://name1.org/");
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( xa.getLength() == 0 );
xa = null;
xt2 = null;
}
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:30,代码来源:TestXMLAttributesC.cs
示例11: test_XMLToken_newSetters_removeAttributes1
public void test_XMLToken_newSetters_removeAttributes1()
{
XMLTriple triple = new XMLTriple("test","","");
XMLAttributes attr = new XMLAttributes();
XMLToken token = new XMLToken(triple,attr);
XMLTriple xt2 = new XMLTriple("name3", "http://name3.org/", "p3");
XMLTriple xt1 = new XMLTriple("name5", "http://name5.org/", "p5");
int i = token.addAttr( "name1", "val1");
i = token.addAttr( "name2", "val2", "http://name1.org/", "p1");
i = token.addAttr(xt2, "val2");
i = token.addAttr( "name4", "val4");
assertTrue( token.getAttributes().getLength() == 4 );
i = token.removeAttr(7);
assertTrue( i == libsbml.LIBSBML_INDEX_EXCEEDS_SIZE );
i = token.removeAttr( "name7");
assertTrue( i == libsbml.LIBSBML_INDEX_EXCEEDS_SIZE );
i = token.removeAttr( "name7", "namespaces7");
assertTrue( i == libsbml.LIBSBML_INDEX_EXCEEDS_SIZE );
i = token.removeAttr(xt1);
assertTrue( i == libsbml.LIBSBML_INDEX_EXCEEDS_SIZE );
assertTrue( token.getAttributes().getLength() == 4 );
i = token.removeAttr(3);
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( token.getAttributes().getLength() == 3 );
i = token.removeAttr( "name1");
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( token.getAttributes().getLength() == 2 );
i = token.removeAttr( "name2", "http://name1.org/");
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( token.getAttributes().getLength() == 1 );
i = token.removeAttr(xt2);
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( token.getAttributes().getLength() == 0 );
xt1 = null;
xt2 = null;
triple = null;
attr = null;
token = null;
}
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:39,代码来源:TestXMLToken_newSetters.cs
示例12: 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
示例13: test_Constraint_copyConstructor
public void test_Constraint_copyConstructor()
{
Constraint o1 = new Constraint(2,4);
o1.setMetaId("c");
assertTrue( o1.getMetaId() == "c" );
XMLNode text = XMLNode.convertStringToXMLNode(" Some text ");
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);
ASTNode math = new ASTNode(libsbml.AST_CONSTANT_PI);
o1.setMath(math);
o1.setMessage(message);
math = null;
message = null;
XMLNode msg;
assertTrue( o1.getMath() != null );
msg = o1.getMessage();
assertTrue( msg != null );
Constraint o2 = new Constraint(o1);
assertTrue( o2.getMetaId() == "c" );
assertTrue( o2.getMath() != null );
msg = o2.getMessage();
assertTrue( msg != null );
assertTrue( o2.getParentSBMLObject() == o1.getParentSBMLObject() );
o2 = null;
o1 = null;
}
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:34,代码来源:TestCopyAndClone.cs
示例14: test_XMLToken_newSetters_removeNamespaces1
public void test_XMLToken_newSetters_removeNamespaces1()
{
XMLTriple triple = new XMLTriple("test","","");
XMLAttributes attr = new XMLAttributes();
XMLToken token = new XMLToken(triple,attr);
token.addNamespace( "http://test1.org/", "test1");
assertTrue( token.getNamespacesLength() == 1 );
int i = token.removeNamespace( "test2");
assertTrue( i == libsbml.LIBSBML_INDEX_EXCEEDS_SIZE );
assertTrue( token.getNamespacesLength() == 1 );
i = token.removeNamespace( "test1");
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( token.getNamespacesLength() == 0 );
token = null;
triple = null;
attr = null;
}
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:17,代码来源:TestXMLToken_newSetters.cs
示例15: getCPtrAndDisown
internal static HandleRef getCPtrAndDisown(XMLAttributes obj)
{
HandleRef ptr = new HandleRef(null, IntPtr.Zero);
if (obj != null)
{
ptr = obj.swigCPtr;
obj.swigCMemOwn = false;
}
return ptr;
}
开发者ID:sys-bio,项目名称:libroadrunner-deps,代码行数:12,代码来源:XMLAttributes.cs
示例16: 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
示例17: setDefinitionURL
/**
* Sets the MathML attribute @c definitionURL.
*
* @param url the URL value for the @c definitionURL attribute.
*
* @return integer value indicating success/failure of the
* function. The possible values returned by this function are:
* @li @link libsbmlcs.libsbml.LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS @endlink
* @li @link libsbmlcs.libsbml.LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT @endlink
*
* @see setDefinitionURL(string url)
* @see getDefinitionURL()
* @see getDefinitionURLString()
*/
public int setDefinitionURL(XMLAttributes url)
{
int ret = libsbmlPINVOKE.ASTNode_setDefinitionURL__SWIG_0(swigCPtr, XMLAttributes.getCPtr(url));
if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
开发者ID:0u812,项目名称:roadrunner-backup,代码行数:20,代码来源:ASTNode.cs
示例18: getAttributes
/**
* Returns the attributes of the XML element represented by this token.
*
* @return the attributes of this XML element, stored in an XMLAttributes
* object.
*/
public XMLAttributes getAttributes()
{
XMLAttributes ret = new XMLAttributes(libsbmlPINVOKE.XMLToken_getAttributes(swigCPtr), false);
return ret;
}
开发者ID:sys-bio,项目名称:libroadrunner-deps,代码行数:11,代码来源:XMLToken.cs
示例19: test_XMLAttributes_add_remove_qname_C
public void test_XMLAttributes_add_remove_qname_C()
{
XMLAttributes xa = new XMLAttributes();
XMLTriple xt1 = new XMLTriple("name1", "http://name1.org/", "p1");
XMLTriple xt2 = new XMLTriple("name2", "http://name2.org/", "p2");
XMLTriple xt3 = new XMLTriple("name3", "http://name3.org/", "p3");
XMLTriple xt1a = new XMLTriple("name1", "http://name1a.org/", "p1a");
XMLTriple xt2a = new XMLTriple("name2", "http://name2a.org/", "p2a");
xa.add( "name1", "val1", "http://name1.org/", "p1");
xa.add(xt2, "val2");
assertTrue( xa.getLength() == 2 );
assertTrue( xa.isEmpty() == false );
assertTrue( ( "name1" != xa.getName(0) ) == false );
assertTrue( ( "val1" != xa.getValue(0) ) == false );
assertTrue( ( "http://name1.org/" != xa.getURI(0) ) == false );
assertTrue( ( "p1" != xa.getPrefix(0) ) == false );
assertTrue( ( "name2" != xa.getName(1) ) == false );
assertTrue( ( "val2" != xa.getValue(1) ) == false );
assertTrue( ( "http://name2.org/" != xa.getURI(1) ) == false );
assertTrue( ( "p2" != xa.getPrefix(1) ) == false );
assertTrue( ( "val1" != xa.getValue( "name1") ) == false );
assertTrue( ( "val2" != xa.getValue( "name2") ) == false );
assertTrue( ( "val1" != xa.getValue( "name1", "http://name1.org/") ) == false );
assertTrue( ( "val2" != xa.getValue( "name2", "http://name2.org/") ) == false );
assertTrue( ( "val1" != xa.getValue(xt1) ) == false );
assertTrue( ( "val2" != xa.getValue(xt2) ) == false );
assertTrue( xa.hasAttribute(-1) == false );
assertTrue( xa.hasAttribute(2) == false );
assertTrue( xa.hasAttribute(0) == true );
assertTrue( xa.hasAttribute( "name1", "http://name1.org/") == true );
assertTrue( xa.hasAttribute( "name2", "http://name2.org/") == true );
assertTrue( xa.hasAttribute( "name3", "http://name3.org/") == false );
assertTrue( xa.hasAttribute(xt1) == true );
assertTrue( xa.hasAttribute(xt2) == true );
assertTrue( xa.hasAttribute(xt3) == false );
xa.add( "noprefix", "val3");
assertTrue( xa.getLength() == 3 );
assertTrue( xa.isEmpty() == false );
assertTrue( ( "noprefix" != xa.getName(2) ) == false );
assertTrue( ( "val3" != xa.getValue(2) ) == false );
assertTrue( xa.getURI(2) == "" );
assertTrue( xa.getPrefix(2) == "" );
assertTrue( ( "val3" != xa.getValue( "noprefix", "") ) == false );
assertTrue( xa.hasAttribute( "noprefix" ) == true );
assertTrue( xa.hasAttribute( "noprefix", "") == true );
xa.add(xt1, "mval1");
xa.add( "name2", "mval2", "http://name2.org/", "p2");
xa.add( "noprefix", "mval3");
assertTrue( xa.getLength() == 3 );
assertTrue( xa.isEmpty() == false );
assertTrue( ( "name1" != xa.getName(0) ) == false );
assertTrue( ( "mval1" != xa.getValue(0) ) == false );
assertTrue( ( "http://name1.org/" != xa.getURI(0) ) == false );
assertTrue( ( "p1" != xa.getPrefix(0) ) == false );
assertTrue( ( "name2" != xa.getName(1) ) == false );
assertTrue( ( "mval2" != xa.getValue(1) ) == false );
assertTrue( ( "http://name2.org/" != xa.getURI(1) ) == false );
assertTrue( ( "p2" != xa.getPrefix(1) ) == false );
assertTrue( ( "noprefix" != xa.getName(2) ) == false );
assertTrue( ( "mval3" != xa.getValue(2) ) == false );
assertTrue( xa.getURI(2) == "" );
assertTrue( xa.getPrefix(2) == "" );
assertTrue( xa.hasAttribute(xt1) == true );
assertTrue( xa.hasAttribute( "name1", "http://name1.org/") == true );
assertTrue( xa.hasAttribute( "noprefix") == true );
xa.add(xt1a, "val1a");
xa.add(xt2a, "val2a");
assertTrue( xa.getLength() == 5 );
assertTrue( ( "name1" != xa.getName(3) ) == false );
assertTrue( ( "val1a" != xa.getValue(3) ) == false );
assertTrue( ( "http://name1a.org/" != xa.getURI(3) ) == false );
assertTrue( ( "p1a" != xa.getPrefix(3) ) == false );
assertTrue( ( "name2" != xa.getName(4) ) == false );
assertTrue( ( "val2a" != xa.getValue(4) ) == false );
assertTrue( ( "http://name2a.org/" != xa.getURI(4) ) == false );
assertTrue( ( "p2a" != xa.getPrefix(4) ) == false );
assertTrue( ( "mval1" != xa.getValue( "name1") ) == false );
assertTrue( ( "mval2" != xa.getValue( "name2") ) == false );
assertTrue( ( "val1a" != xa.getValue( "name1", "http://name1a.org/") ) == false );
assertTrue( ( "val2a" != xa.getValue( "name2", "http://name2a.org/") ) == false );
assertTrue( ( "val1a" != xa.getValue(xt1a) ) == false );
assertTrue( ( "val2a" != xa.getValue(xt2a) ) == false );
xa.remove(xt1a);
xa.remove(xt2a);
assertTrue( xa.getLength() == 3 );
xa.remove( "name1", "http://name1.org/");
assertTrue( xa.getLength() == 2 );
assertTrue( xa.isEmpty() == false );
assertTrue( ( "name2" != xa.getName(0) ) == false );
assertTrue( ( "mval2" != xa.getValue(0) ) == false );
assertTrue( ( "http://name2.org/" != xa.getURI(0) ) == false );
assertTrue( ( "p2" != xa.getPrefix(0) ) == false );
assertTrue( ( "noprefix" != xa.getName(1) ) == false );
assertTrue( ( "mval3" != xa.getValue(1) ) == false );
assertTrue( xa.getURI(1) == "" );
assertTrue( xa.getPrefix(1) == "" );
assertTrue( xa.hasAttribute( "name1", "http://name1.org/") == false );
xa.remove(xt2);
assertTrue( xa.getLength() == 1 );
assertTrue( xa.isEmpty() == false );
//.........这里部分代码省略.........
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:101,代码来源:TestXMLAttributesC.cs
示例20: XMLToken
/**
* Creates an XML start element with attributes.
*
* @param triple an XMLTriple object describing the start tag.
*
* @param attributes XMLAttributes, the attributes to set on the element to
* be created.
*
* @param line a long integer, the line number to associate with the
* token (default = 0).
*
* @param column a long integer, the column number to associate with the
* token (default = 0).
*
* The XML namespace component of this XMLToken object will be left empty.
* See the other variants of the XMLToken constructors for versions that
* take namespace arguments.
*
* @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif
*/
public XMLToken(XMLTriple triple, XMLAttributes attributes)
: this(libsbmlPINVOKE.new_XMLToken__SWIG_6(XMLTriple.getCPtr(triple), XMLAttributes.getCPtr(attributes)), true)
{
if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
}
开发者ID:sys-bio,项目名称:libroadrunner-deps,代码行数:25,代码来源:XMLToken.cs
注:本文中的libsbml.XMLAttributes类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论