本文整理汇总了C#中libsbml.XMLNode.getNamespaces方法的典型用法代码示例。如果您正苦于以下问题:C# XMLNode.getNamespaces方法的具体用法?C# XMLNode.getNamespaces怎么用?C# XMLNode.getNamespaces使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libsbml.XMLNode
的用法示例。
在下文中一共展示了XMLNode.getNamespaces方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: test_XMLNode_removeNamespaces
public void test_XMLNode_removeNamespaces()
{
XMLTriple triple = new XMLTriple("test","","");
XMLAttributes attr = new XMLAttributes();
XMLNode node = new XMLNode(triple,attr);
XMLNamespaces nms;
int i = node.addNamespace( "http://test1.org/", "test1");
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
nms = node.getNamespaces();
assertTrue( nms.getLength() == 1 );
i = node.addNamespace( "http://test2.org/", "test2");
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
nms = node.getNamespaces();
assertTrue( nms.getLength() == 2 );
i = node.removeNamespace(7);
assertTrue( i == libsbml.LIBSBML_INDEX_EXCEEDS_SIZE );
nms = node.getNamespaces();
assertTrue( nms.getLength() == 2 );
i = node.removeNamespace( "name7");
assertTrue( i == libsbml.LIBSBML_INDEX_EXCEEDS_SIZE );
nms = node.getNamespaces();
assertTrue( nms.getLength() == 2 );
i = node.removeNamespace(0);
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
nms = node.getNamespaces();
assertTrue( nms.getLength() == 1 );
i = node.removeNamespace( "test2");
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
nms = node.getNamespaces();
assertTrue( nms.getLength() == 0 );
triple = null;
attr = null;
node = null;
}
示例2: test_XMLNode_getters
public void test_XMLNode_getters()
{
XMLToken token;
XMLNode node;
XMLTriple triple;
XMLAttributes attr;
XMLNamespaces NS;
NS = new XMLNamespaces();
NS.add( "http://test1.org/", "test1");
token = new XMLToken("This is a test");
node = new XMLNode(token);
assertTrue( node != null );
assertTrue( node.getNumChildren() == 0 );
assertTrue( ( "This is a test" != node.getCharacters() ) == false );
assertTrue( node.getChild(1) != null );
attr = new XMLAttributes();
assertTrue( attr != null );
attr.add( "attr2", "value");
triple = new XMLTriple("attr", "uri", "prefix");
token = new XMLToken(triple,attr);
assertTrue( token != null );
node = new XMLNode(token);
assertTrue( ( "attr" != node.getName() ) == false );
assertTrue( ( "uri" != node.getURI() ) == false );
assertTrue( ( "prefix" != node.getPrefix() ) == false );
XMLAttributes returnattr = node.getAttributes();
assertTrue( ( "attr2" != returnattr.getName(0) ) == false );
assertTrue( ( "value" != returnattr.getValue(0) ) == false );
token = new XMLToken(triple,attr,NS);
node = new XMLNode(token);
XMLNamespaces returnNS = node.getNamespaces();
assertTrue( returnNS.getLength() == 1 );
assertTrue( returnNS.isEmpty() == false );
triple = null;
token = null;
node = null;
}