本文整理汇总了C++中msxml2::IXMLDOMNodePtr::Gettext方法的典型用法代码示例。如果您正苦于以下问题:C++ IXMLDOMNodePtr::Gettext方法的具体用法?C++ IXMLDOMNodePtr::Gettext怎么用?C++ IXMLDOMNodePtr::Gettext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类msxml2::IXMLDOMNodePtr
的用法示例。
在下文中一共展示了IXMLDOMNodePtr::Gettext方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetProperty
bstr_t CCMSDIntegrator::GetProperty(MSXML2::IXMLDOMNodePtr pNode,bstr_t PropName, bstr_t defaultVal, bstr_t NodeType)
{
MSXML2::IXMLDOMNodeListPtr properties = pNode->selectNodes(NodeType);
for(int j=0; j< properties->length; j++)
{
MSXML2::IXMLDOMNodePtr pProp = NULL;
properties->get_item(j, &pProp);
MSXML2::IXMLDOMNodePtr pName = pProp->selectSingleNode(bstr_t(".//Name"));
MSXML2::IXMLDOMNodePtr pValue = pProp->selectSingleNode(bstr_t(".//Value"));
bstr_t propName = (pName!=NULL) ? pName->Gettext() : L"None";
if( propName == PropName)
{
return (pValue!=NULL) ? pValue->Gettext() : defaultVal;
}
}
return defaultVal;
}
示例2: GetNameValueProperties
MappedValues CCMSDIntegrator::GetNameValueProperties(MSXML2::IXMLDOMNodePtr pNode, bstr_t NodeType)
{
MappedValues namedvalues;
MSXML2::IXMLDOMNodeListPtr properties= pNode->selectNodes(NodeType);
for(int j=0; j< properties->length; j++)
{
MSXML2::IXMLDOMNodePtr pProp = NULL;
properties->get_item(j, &pProp);
MSXML2::IXMLDOMNodePtr pName = pProp->selectSingleNode(bstr_t(".//Name"));
MSXML2::IXMLDOMNodePtr pValue = pProp->selectSingleNode(bstr_t(".//Value"));
bstr_t propName = (pName!=NULL) ? pName->Gettext() : L"None";
bstr_t propValue = (pValue!=NULL) ? pValue->Gettext() : L"None";
if( propName != bstr_t(L"None") && propValue != bstr_t(L"None"))
{
namedvalues[propName]=propValue;
}
}
return namedvalues;
}
示例3: GetValue
CString CXmlNodeWrapper::GetValue(LPCTSTR valueName)
{
if (!IsValid())
return _T("");
MSXML2::IXMLDOMNodePtr attribute = m_xmlnode->Getattributes()->getNamedItem(valueName);
if (attribute)
{
return (LPCTSTR)attribute->Gettext();
}
return _T("");
}
示例4: GetElement
bstr_t CCMSDIntegrator::GetElement(MSXML2::IXMLDOMNodePtr pNode,bstr_t ElementName, bstr_t defaultVal)
{
MSXML2::IXMLDOMNodePtr pElement = pNode->selectSingleNode(ElementName);
return (pElement!=NULL) ? pElement->Gettext() : defaultVal;
}
示例5: ParseDataItems
DataDictionary MTConnectStreamsParser::ParseDataItems()
{
MSXML2::IXMLDOMNodePtr root = m_pXMLDoc->GetdocumentElement();
MSXML2::IXMLDOMNodeListPtr nodes = root->selectNodes(_bstr_t("//DeviceStream"));
DataDictionary data;
try
{
for(int i=0; i< nodes->length; i++)
{
MSXML2::IXMLDOMNodePtr pNode = NULL;
nodes->get_item(i, &pNode);
_bstr_t items[3] = {_bstr_t(".//Samples"), _bstr_t(".//Events"), _bstr_t(".//Condition") };
for(int ii=0; ii<3 ; ii++)
{
MSXML2::IXMLDOMNodeListPtr samples = pNode->selectNodes(items[ii]);
for(int j=0; j< samples->length; j++)
{
MSXML2::IXMLDOMNodePtr pSampleHive = NULL;
samples->get_item(j, &pSampleHive);
// Get each child
MSXML2::IXMLDOMNodeListPtr childs = pSampleHive->childNodes;
for(int k=0; k< childs->length; k++)
{
MSXML2::IXMLDOMNodePtr pSample = NULL;
ptime datetime;
std::string name ;
std::string timestamp;
std::string sequence;
childs->get_item(k, &pSample);
name = (LPCSTR) GetAttribute(pSample, "name");
if(name.empty())
name = (LPCSTR) GetAttribute(pSample, "dataItemId");
if(name.empty())
continue;
timestamp = (LPCSTR) GetAttribute(pSample, "timestamp");
sequence = (LPCSTR) GetAttribute(pSample, "sequence");
// Lookup any name remapping to shorten
if(TagRenames.find(name)!= TagRenames.end())
{
name = TagRenames[name];
}
if(items[ii] == _bstr_t(".//Samples"))
data[name]=(LPCSTR) pSample->Gettext();
else if(items[ii] == _bstr_t(".//Events"))
data[name]=(LPCSTR) pSample->Gettext();
else if(items[ii] == _bstr_t(".//Condition"))
{
std::string tagname = (LPCSTR) GetElement(pSample);
if(stricmp(tagname.c_str(),"FAULT")==0)
data[name]="fault";
else
data[name]="normal";
}
}
}
}
}
}
catch(...)
{
std::cout<< "MTConnectStreamsParser::ParseDataItems() Exception\n";
}
return data;
}