本文整理汇总了C#中libsbmlcs.XMLNode类的典型用法代码示例。如果您正苦于以下问题:C# XMLNode类的具体用法?C# XMLNode怎么用?C# XMLNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XMLNode类属于libsbmlcs命名空间,在下文中一共展示了XMLNode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: 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
示例2: 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
示例3: test_XMLNode_addChild1
public void test_XMLNode_addChild1()
{
XMLNode node = new XMLNode();
XMLNode node2 = new XMLNode();
int i = node.addChild(node2);
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( node.getNumChildren() == 1 );
node = null;
node2 = null;
}
开发者ID:0u812,项目名称:roadrunner-backup,代码行数:10,代码来源:TestXMLNode_newSetters.cs
示例4: test_XMLNode_addChild3
public void test_XMLNode_addChild3()
{
XMLTriple triple = new XMLTriple("test","","");
XMLNode node = new XMLNode(triple);
XMLNode node2 = new XMLNode();
int i = node.addChild(node2);
assertTrue( i == libsbml.LIBSBML_INVALID_XML_OPERATION );
assertTrue( node.getNumChildren() == 0 );
triple = null;
node = null;
node2 = null;
}
开发者ID:0u812,项目名称:roadrunner-backup,代码行数:12,代码来源:TestXMLNode_newSetters.cs
示例5: test_ASTNode_addSemanticsAnnotation
public void test_ASTNode_addSemanticsAnnotation()
{
XMLNode ann = new XMLNode();
ASTNode node = new ASTNode();
int i = 0;
i = node.addSemanticsAnnotation(ann);
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( node.getNumSemanticsAnnotations() == 1 );
i = node.addSemanticsAnnotation(null);
assertTrue( i == libsbml.LIBSBML_OPERATION_FAILED );
assertTrue( node.getNumSemanticsAnnotations() == 1 );
node = null;
}
开发者ID:TotteKarlsson,项目名称:roadrunner,代码行数:13,代码来源:TestASTNode.cs
示例6: 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
示例7: test_Constraint_setMessage1
public void test_Constraint_setMessage1()
{
XMLNode node = new XMLNode();
int i = C.setMessage(node);
assertTrue( i == libsbml.LIBSBML_INVALID_OBJECT );
assertTrue( C.isSetMessage() == false );
i = C.unsetMessage();
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertEquals( false, C.isSetMessage() );
if (C.getMessage() != null);
{
}
node = null;
}
开发者ID:0u812,项目名称:roadrunner-backup,代码行数:14,代码来源:TestConstraint_newSetters.cs
示例8: 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
示例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: equals
/**
* Compare this XMLNode against another XMLNode returning true if both
* nodes represent the same XML tree, or false otherwise.
*
* @param other another XMLNode to compare against.
*
* @param ignoreURI whether to ignore the namespace URI when doing the
* comparison.
*
* @return bool indicating whether this XMLNode represents the same XML
* tree as another.
*/
public bool equals(XMLNode other)
{
bool ret = libsbmlPINVOKE.XMLNode_equals__SWIG_1(swigCPtr, XMLNode.getCPtr(other));
if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
开发者ID:kirichoi,项目名称:roadrunner,代码行数:18,代码来源:XMLNode.cs
示例11: addChild
/**
* Adds a copy of @p node as a child of this XMLNode.
*
* The given @p node is added at the end of the list of children.
*
* @param node the XMLNode to be added as child.
*
* @return integer value indicating success/failure of the
* function. The possible values
* returned by this function are:
* @li @link libsbmlcs#LIBSBML_OPERATION_SUCCESS [email protected]
* @li @link libsbmlcs#LIBSBML_INVALID_XML_OPERATION [email protected]
*
* @note The given node is added at the end of the children list.
*/
public int addChild(XMLNode node)
{
int ret = libsbmlPINVOKE.XMLNode_addChild(swigCPtr, XMLNode.getCPtr(node));
if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
开发者ID:kirichoi,项目名称:roadrunner,代码行数:21,代码来源:XMLNode.cs
示例12: convertXMLNodeToString
/**
* Returns a string representation of a given XMLNode.
*
* @param node the XMLNode to be represented as a string
*
* @return a string-form representation of @p node
*/
public static string convertXMLNodeToString(XMLNode node)
{
string ret = libsbmlPINVOKE.XMLNode_convertXMLNodeToString(XMLNode.getCPtr(node));
return ret;
}
开发者ID:kirichoi,项目名称:roadrunner,代码行数:12,代码来源:XMLNode.cs
示例13: XMLNode
/**
* Copy constructor; creates a copy of this XMLNode.
*
* @param orig the XMLNode instance to copy.
*
* @throws XMLConstructorException
* Thrown if the argument @p orig is @c null.
*/
public XMLNode(XMLNode orig)
: this(libsbmlPINVOKE.new_XMLNode__SWIG_15(XMLNode.getCPtr(orig)), true)
{
if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
}
开发者ID:kirichoi,项目名称:roadrunner,代码行数:13,代码来源:XMLNode.cs
示例14: setAnnotation
/**
* Sets the value of the 'annotation' subelement of this SBML object to a
* copy of @p annotation.
*
* Any existing content of the 'annotation' subelement is discarded.
* Unless you have taken steps to first copy and reconstitute any
* existing annotations into the @p annotation that is about to be
* assigned, it is likely that performing such wholesale replacement is
* unfriendly towards other software applications whose annotations are
* discarded. An alternative may be to use appendAnnotation().
*
* @param annotation an XML structure that is to be used as the content
* of the 'annotation' subelement of this object
*
*
* @return integer value indicating success/failure of the
* function. @if clike The value is drawn from the
* enumeration #OperationReturnValues_t. @endif The possible values
* returned by this function are:
* @li @link libsbml#LIBSBML_OPERATION_SUCCESS [email protected]
*
* @see appendAnnotation(XMLNode annotation)
*/
public new int setAnnotation(XMLNode annotation)
{
int ret = libsbmlPINVOKE.Model_setAnnotation__SWIG_0(swigCPtr, XMLNode.getCPtr(annotation));
return ret;
}
开发者ID:sys-bio,项目名称:libroadrunner-deps,代码行数:28,代码来源:Model.cs
示例15: appendAnnotation
/**
* Appends the given @p annotation to the 'annotation' subelement of this
* object.
*
* Whereas the SBase 'notes' subelement is a container for content to be
* shown directly to humans, the 'annotation' element is a container for
* optional software-generated content @em not meant to be shown to
* humans. Every object derived from SBase can have its own value for
* 'annotation'. The element's content type is <a
* target='_blank'
* href='http://www.w3.org/TR/2004/REC-xml-20040204/#elemdecls'>XML type 'any'</a>,
* allowing essentially arbitrary well-formed XML data content.
*
* SBML places a few restrictions on the organization of the content of
* annotations; these are intended to help software tools read and write
* the data as well as help reduce conflicts between annotations added by
* different tools. Please see the SBML specifications for more details.
*
* Unlike SBase::setAnnotation(XMLNode annotation) or
* SBase::setAnnotation(string annotation), this method
* allows other annotations to be preserved when an application adds its
* own data.
*
* @param annotation an XML structure that is to be copied and appended
* to the content of the 'annotation' subelement of this object
*
* @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_OPERATION_FAILED LIBSBML_OPERATION_FAILED @endlink
*
* @see getAnnotationString()
* @see isSetAnnotation()
* @see setAnnotation(XMLNode annotation)
* @see setAnnotation(string annotation)
* @see appendAnnotation(string annotation)
* @see unsetAnnotation()
*/
public int appendAnnotation(XMLNode annotation)
{
int ret = libsbmlPINVOKE.SBase_appendAnnotation__SWIG_0(swigCPtr, XMLNode.getCPtr(annotation));
return ret;
}
开发者ID:TotteKarlsson,项目名称:roadrunner,代码行数:43,代码来源:SBase.cs
示例16: insertChild
/**
* Inserts a copy of the given node as the <code>n</code>th child of this
* XMLNode.
*
* If the given index @p n is out of range for this XMLNode instance,
* the @p node is added at the end of the list of children. Even in
* that situation, this method does not throw an error.
*
* @param n an integer, the index at which the given node is inserted
* @param node an XMLNode to be inserted as <code>n</code>th child.
*
* @return a reference to the newly-inserted child @p node
*/
public XMLNode insertChild(long n, XMLNode node)
{
XMLNode ret = new XMLNode(libsbmlPINVOKE.XMLNode_insertChild(swigCPtr, n, XMLNode.getCPtr(node)), false);
if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
开发者ID:kirichoi,项目名称:roadrunner,代码行数:19,代码来源:XMLNode.cs
示例17: getCPtrAndDisown
internal static HandleRef getCPtrAndDisown(XMLNode obj)
{
HandleRef ptr = new HandleRef(null, IntPtr.Zero);
if (obj != null)
{
ptr = obj.swigCPtr;
obj.swigCMemOwn = false;
}
return ptr;
}
开发者ID:kirichoi,项目名称:roadrunner,代码行数:12,代码来源:XMLNode.cs
示例18: getChild
/**
* Returns the <code>n</code>th child of this XMLNode.
*
* If the index @p n is greater than the number of child nodes,
* this method returns an empty node.
*
* @param n a long integereger, the index of the node to return
*
* @return the <code>n</code>th child of this XMLNode.
*/
public XMLNode getChild(long n)
{
XMLNode ret = new XMLNode(libsbmlPINVOKE.XMLNode_getChild__SWIG_0(swigCPtr, n), false);
return ret;
}
开发者ID:kirichoi,项目名称:roadrunner,代码行数:15,代码来源:XMLNode.cs
示例19: 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
示例20: 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);
int i = S.setNotes(body_node);
i = S.appendNotes(p_node1);
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
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:sys-bio,项目名称:libroadrunner-deps,代码行数:58,代码来源:TestSBase_newSetters.cs
注:本文中的libsbmlcs.XMLNode类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论