本文整理汇总了C++中Attr::getNodeValue方法的典型用法代码示例。如果您正苦于以下问题:C++ Attr::getNodeValue方法的具体用法?C++ Attr::getNodeValue怎么用?C++ Attr::getNodeValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Attr
的用法示例。
在下文中一共展示了Attr::getNodeValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runTest
/*
* Runs the test case.
*/
void runTest()
{
Document doc;
NodeList acronymList;
Node testNode;
NamedNodeMap attributes;
Attr titleAttr;
String value;
Text textNode;
Node retval;
Node lastChild;
doc = (Document) baseT::load("hc_staff", true);
titleAttr = doc.createAttribute(SA::construct_from_utf8("title"));
textNode = doc.createTextNode(SA::construct_from_utf8("Yesterday"));
retval = titleAttr.appendChild(textNode);
value = titleAttr.getValue();
baseT::assertEquals("Yesterday", value, __LINE__, __FILE__);
value = titleAttr.getNodeValue();
baseT::assertEquals("Yesterday", value, __LINE__, __FILE__);
value = retval.getNodeValue();
baseT::assertEquals("Yesterday", value, __LINE__, __FILE__);
lastChild = titleAttr.getLastChild();
value = lastChild.getNodeValue();
baseT::assertEquals("Yesterday", value, __LINE__, __FILE__);
}
示例2: runTest
/*
* Runs the test case.
*/
void runTest()
{
Document doc;
NodeList addressList;
Node testNode;
NamedNodeMap attributes;
Attr domesticAttr;
String value;
doc = (Document) baseT::load("hc_staff", false);
addressList = doc.getElementsByTagName(SA::construct_from_utf8("acronym"));
testNode = addressList.item(0);
attributes = testNode.getAttributes();
domesticAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title"));
value = domesticAttr.getNodeValue();
baseT::assertEquals("Yes", value, __LINE__, __FILE__);
}
示例3: runTest
/*
* Runs the test case.
*/
void runTest()
{
Document doc;
Attr newAttrNode;
String attrValue;
String attrName;
int attrType;
doc = (Document) baseT::load("staff", true);
newAttrNode = doc.createAttribute(SA::construct_from_utf8("district"));
attrValue = newAttrNode.getNodeValue();
baseT::assertEquals("", attrValue, __LINE__, __FILE__);
attrName = newAttrNode.getNodeName();
baseT::assertEquals("district", attrName, __LINE__, __FILE__);
attrType = (int) newAttrNode.getNodeType();
baseT::assertEquals(2, attrType, __LINE__, __FILE__);
}