本文整理汇总了C++中msxml2::IXMLDOMNodePtr::selectSingleNode方法的典型用法代码示例。如果您正苦于以下问题:C++ IXMLDOMNodePtr::selectSingleNode方法的具体用法?C++ IXMLDOMNodePtr::selectSingleNode怎么用?C++ IXMLDOMNodePtr::selectSingleNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类msxml2::IXMLDOMNodePtr
的用法示例。
在下文中一共展示了IXMLDOMNodePtr::selectSingleNode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsPropertyElement
bool PropertyElement::IsPropertyElement(MSXML2::IXMLDOMNodePtr pNode)
{
MSXML2::IXMLDOMNodePtr pNameElement = pNode->selectSingleNode(bstr_t(L"Name"));
MSXML2::IXMLDOMNodePtr pValueElement = pNode->selectSingleNode(bstr_t(L"Value"));
if(pNameElement!=NULL && pValueElement !=NULL)
return true;
return false;
}
示例2: IsDistributionReferenceProperty
bool PropertyElement::IsDistributionReferenceProperty(MSXML2::IXMLDOMNodePtr pNode)
{
MSXML2::IXMLDOMNodePtr pDistRefElement = pNode->selectSingleNode(bstr_t(L"./DistributionDefinitionReference/DistributionDefinitionIdentifier"));
if(pDistRefElement !=NULL)
return true;
return false;
}
示例3: FindOptionEnumItemLabelFromValue
CString CTransformationsDialog::FindOptionEnumItemLabelFromValue(
MSXML2::IXMLDOMNodePtr & options_node,
LPCTSTR variable_name,
LPCTSTR otion_value)
{
CString value_label_query_str;
value_label_query_str.Format(
"/visualization/visualization_options/enum_option[@variable_name=\"%s\"]/enum_item[@value = \"%s\"]/@label",
variable_name, otion_value);
_bstr_t ret;
try
{
ret = options_node->selectSingleNode((LPCTSTR) value_label_query_str)->text;
}
catch (_com_error &)
{
CString msg;
msg.Format("Label for value \"%s\" of enum variable \"%s\" is missing.", otion_value, variable_name);
throw msg;
}
return (LPCTSTR) ret;
}
示例4: 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;
}
示例5: getChildText
String getChildText(MSXML2::IXMLDOMNodePtr& parent, const String& childNodeName) {
MSXML2::IXMLDOMNodePtr child = parent->selectSingleNode(childNodeName.c_str());
if (child == NULL) {
throw XMLUtils::ParseError();
}
return getNodeText(child);
}
示例6: 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;
}
示例7: FindOptionEnumItemValueFromLabel
CString CTransformationsDialog::FindOptionEnumItemValueFromLabel(
MSXML2::IXMLDOMNodePtr & options_node,
LPCTSTR variable_name,
LPCTSTR otion_label)
{
CString label_query_str;
label_query_str.Format(
"/visualization/visualization_options/enum_option[@variable_name=\"%s\"]/enum_item[@label = \"%s\"]/@value",
variable_name, otion_label);
return (LPCTSTR) options_node->selectSingleNode((LPCTSTR) label_query_str)->text;
}
示例8: ParseBBox
BOOL CVCAMetaParserMSXML::ParseBBox( MSXML2::IXMLDOMNodePtr pNode, VCA5_RECT *pBbox )
{
MSXML2::IXMLDOMNodePtr pSubNode;
CComBSTR bsTag;
// Bounding Box
bsTag = CComBSTR( _XML_BB ) += CComBSTR("/") += CComBSTR( _XML_X );
pSubNode = pNode->selectSingleNode( bsTag.operator BSTR() );
if( pSubNode )
{
VarUI2FromStr( pSubNode->text, LCID_ENGLISH, LOCALE_NOUSEROVERRIDE, (unsigned short *)&pBbox->x );
}
bsTag = CComBSTR( _XML_BB ) += CComBSTR("/") += CComBSTR( _XML_Y );
pSubNode = pNode->selectSingleNode( bsTag.operator BSTR() );
if( pSubNode )
{
VarUI2FromStr( pSubNode->text, LCID_ENGLISH, LOCALE_NOUSEROVERRIDE, (unsigned short *)&pBbox->y );
}
bsTag = CComBSTR( _XML_BB ) += CComBSTR("/") += CComBSTR( _XML_W );
pSubNode = pNode->selectSingleNode( bsTag.operator BSTR() );
if( pSubNode )
{
VarUI2FromStr( pSubNode->text, LCID_ENGLISH, LOCALE_NOUSEROVERRIDE, (unsigned short *)&pBbox->w );
}
bsTag = CComBSTR( _XML_BB ) += CComBSTR("/") += CComBSTR( _XML_H );
pSubNode = pNode->selectSingleNode( bsTag.operator BSTR() );
if( pSubNode )
{
VarUI2FromStr( pSubNode->text, LCID_ENGLISH, LOCALE_NOUSEROVERRIDE, (unsigned short *)&pBbox->h);
}
return TRUE;
}
示例9: readMesh
void readMesh(dae_reader_t *reader, MSXML2::IXMLDOMNodePtr geometry)
{
MSXML2::IXMLDOMNodePtr mesh = geometry->selectSingleNode("r:mesh");
if (mesh == NULL) return;
geometry_t object;
MSXML2::IXMLDOMNamedNodeMapPtr attributes = geometry->attributes;
if (attributes->length > 0)
object.name = attributes->getNamedItem("name")->text;
readVerticesNormalsTexcoords(mesh, object);
readTriangles(mesh, object);
object.maxIndex = 0;
reader->geometry.push_back(object);
}
示例10: LoadXmlElement
HRESULT PlotWindowOpened::LoadXmlElement(MSXML2::IXMLDOMNodePtr pElement)
{
CString cs;
MSXML2::IXMLDOMNodePtr pNode;
pNode = pElement->selectSingleNode(L"WndName");
if (pNode != 0)
{
cs.Format(_T("%S"),(LPCSTR)pNode->text);
this->_name = cs;
}
else
{
this->_name = L"invalid name";
}
pNode = pElement->selectSingleNode(L"WndNameIsSet");
if (pNode != 0)
{
if(pNode->text == (_bstr_t)(L"0"))
this->_bNameIsSet = false;
else
this->_bNameIsSet = true;
}
pNode = pElement->selectSingleNode(L"WndRectTLX");
if (pNode == 0)
goto RET;
int tlx = atoi((LPCSTR)(pNode->text));
pNode = pElement->selectSingleNode(L"WndRectTLY");
if (pNode == 0)
goto RET;
int tly = atoi((LPCSTR)(pNode->text));
pNode = pElement->selectSingleNode(L"WndRectBRX");
if (pNode == 0)
goto RET;
int brx = atoi((LPCSTR)(pNode->text));
pNode = pElement->selectSingleNode(L"WndRectBRY");
if (pNode == 0)
goto RET;
int bry = atoi((LPCSTR)(pNode->text));
this->_rect.SetRect(tlx,tly,brx,bry);
RET:
return S_OK;
}
示例11: readTriangles
void readTriangles(MSXML2::IXMLDOMNodePtr mesh, geometry_t &geometry)
{
MSXML2::IXMLDOMNodeListPtr polyLists = mesh->selectNodes("r:polylist"); // blender
MSXML2::IXMLDOMNodePtr p;
if (polyLists->length == 0)
polyLists = mesh->selectNodes("r:triangles"); // 3dsmax
for (int i = 0; i < polyLists->length; i++)
{
MSXML2::IXMLDOMNodePtr polylist = polyLists->item[i];
MSXML2::IXMLDOMNodePtr p = polylist->selectSingleNode("r:p");
if (p == NULL) continue;
geometry.vertexOffset.push_back(-1);
geometry.normalOffset.push_back(-1);
geometry.texcoordOffset.push_back(-1);
MSXML2::IXMLDOMNodeListPtr inputList = polylist->selectNodes("r:input");
for (int j = 0; j < inputList->length; j++)
{
MSXML2::IXMLDOMNodePtr input = inputList->Getitem(j);
MSXML2::IXMLDOMNamedNodeMapPtr attributes = input->attributes;
string semantic = (_bstr_t)_wcslwr((wchar_t *)attributes->getNamedItem("semantic")->text);
int offset = _wtoi(attributes->getNamedItem("offset")->text);
if (semantic == "vertex")
geometry.vertexOffset[geometry.vertexOffset.size() - 1] = offset;
else if (semantic == "normal")
geometry.normalOffset[geometry.normalOffset.size() - 1] = offset;
else if (semantic == "texcoord")
geometry.texcoordOffset[geometry.texcoordOffset.size() - 1] = offset;
}
vector<int> v = readValues<int>(p);
geometry.triangles.push_back(v);
}
}
示例12: 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;
}
示例13: nLoadHeader
/******************************************************************************
Function Name : nLoadHeader
Input(s) : MSXML2::IXMLDOMNodePtr& pHeaderDOMNode
Output : INT
Functionality : Retrives the Header info
Member of : CTestSetupEntity
Friend of : -
Author(s) : Venkatanarayana Makam
Date Created : 06/04/2011
Modifications :
Codetag :
******************************************************************************/
INT CTestSetupEntity::nLoadHeader(MSXML2::IXMLDOMNodePtr& pHeaderDOMNode)
{
// CComPtr<IXMLDOMNode> pHeaderDOMNode;
MSXML2::IXMLDOMNodeListPtr pXMLDOMInfoList;
MSXML2::IXMLDOMNodePtr pInfoNode;
MSXML2::IXMLDOMNodePtr pInfoCategoryNode;
MSXML2::IXMLDOMNodePtr pInfoValueNode;
_bstr_t bstrNodeName = "info";
CComVariant NodeValue;
pXMLDOMInfoList = pHeaderDOMNode->selectNodes(bstrNodeName);
LONG lCount = 0;
pXMLDOMInfoList->get_length(&lCount);
SInfo ouTempSInfo;
for(int i = 0; i<lCount; i++)
{
pInfoNode = pXMLDOMInfoList->Getitem(i);
//bstrNodeName = def_STR_CATEGORY_NODE;
bstrNodeName.Assign(SysAllocString(CT2W(def_STR_CATEGORY_NODE)));
pInfoCategoryNode = pInfoNode->selectSingleNode(bstrNodeName);
pInfoCategoryNode->get_nodeTypedValue(&NodeValue);
ouTempSInfo.m_omCategory = strCopyBSTRToCString(NodeValue);
pInfoCategoryNode.Release();
//bstrNodeName = def_STR_VALUE_NODE;
bstrNodeName.Assign(SysAllocString(CT2W(def_STR_VALUE_NODE)));
pInfoCategoryNode = pInfoNode->selectSingleNode(bstrNodeName);
pInfoCategoryNode->get_nodeTypedValue(&NodeValue);
ouTempSInfo.m_omValue = strCopyBSTRToCString(NodeValue);
pInfoCategoryNode.Release();
pInfoNode.Release();
if(ouTempSInfo.m_omCategory == def_STR_MODULENAME)
{
m_ouTestSetupHeader.m_sModuleName.m_omCategory = ouTempSInfo.m_omCategory;
m_ouTestSetupHeader.m_sModuleName.m_omValue = ouTempSInfo.m_omValue;
}
if(ouTempSInfo.m_omCategory == def_STR_ENGINEERNAME)
{
m_ouTestSetupHeader.m_sEngineerInfo1.m_omCategory = ouTempSInfo.m_omCategory;
m_ouTestSetupHeader.m_sEngineerInfo1.m_omValue = ouTempSInfo.m_omValue;
}
if(ouTempSInfo.m_omCategory == def_STR_ENGINERROLE)
{
m_ouTestSetupHeader.m_sEngineerInfo2.m_omCategory = ouTempSInfo.m_omCategory;
m_ouTestSetupHeader.m_sEngineerInfo2.m_omValue = ouTempSInfo.m_omValue;
}
if(ouTempSInfo.m_omCategory == def_STR_VERSION)
{
m_ouTestSetupHeader.m_sVersion.m_omCategory = ouTempSInfo.m_omCategory;
m_ouTestSetupHeader.m_sVersion.m_omValue = ouTempSInfo.m_omValue;
}
}
//Taking Database
//bstrNodeName = def_STR_LISTOFDB;
bstrNodeName.Assign(SysAllocString(CT2W(def_STR_LISTOFDB)));
pInfoNode = pHeaderDOMNode->selectSingleNode(bstrNodeName);
pInfoNode->get_nodeTypedValue(&NodeValue);
m_ouTestSetupHeader.m_omDatabasePath = strCopyBSTRToCString(NodeValue);
//Set The Database Path
SetDatabaseFile(m_ouTestSetupHeader.m_omDatabasePath);
pInfoNode.Release();
//bstrNodeName = def_STR_REPORT_FORMAT;
bstrNodeName.Assign(SysAllocString(CT2W(def_STR_REPORT_FORMAT)));
pInfoNode = pHeaderDOMNode->selectSingleNode(bstrNodeName);
pInfoNode->get_nodeTypedValue(&NodeValue);
CString omStrExt;
omStrExt = strCopyBSTRToCString(NodeValue);
pInfoNode.Release();
if(omStrExt == "HTM")
{
m_ouTestSetupHeader.m_sReportFile.m_eType = HTM;
}
else
{
m_ouTestSetupHeader.m_sReportFile.m_eType = TXT;
}
//bstrNodeName = def_STR_REPORT_PATH;
//.........这里部分代码省略.........
示例14: Initial
void CQuickConnection::Initial(void)
{
IXMLDOMDocument2Ptr pConfig;
#ifdef _DEBUG
CFileSys::ConvertBinaryXML( "script\\QuickConnection.xml","script\\QuickConnection.bml" );
FILE* fIn;
if( NULL != (fIn=fopen( "script\\QuickConnection.bml","rb" )))
{
CFileSys::LoadBinaryXML( pConfig, fIn );
}
fclose( fIn );
#else
DFileGPack packFile;
packFile.Open(SFullName("script","QuickConnection.bml"));
CFileSys::LoadBinaryXML(pConfig, packFile.GetFile(), packFile.GetSize());
packFile.Close();
#endif
MSXML2::IXMLDOMNodePtr pNode = NULL;
if( pNode = pConfig->selectSingleNode( L"./root/quick_mode" ) )
{
long nIsQuickMode = pNode->GetnodeTypedValue();
m_nIsQuickMode = nIsQuickMode;
}
if( pNode = pConfig->selectSingleNode( L"./root/frame_speed_on" ) )
{
long nFrameSpeedOn = pNode->GetnodeTypedValue();
m_nFrameSpeedOn = nFrameSpeedOn;
}
if( pNode = pConfig->selectSingleNode( L"./root/full_court" ) )
{
long nFullCourt = pNode->GetnodeTypedValue();
m_nIsFullCourt = nFullCourt;
}
if( pNode = pConfig->selectSingleNode( L"./root/select_host" ) )
{
long nIsHost = pNode->GetnodeTypedValue(); // long, short.
m_nIsHost = nIsHost;
//
}
// 중앙 서버의 ip 주소를 얻어 온다.
if(pNode = pConfig->selectSingleNode(L"./root/server_option/server_addr"))
{
_bstr_t server_addr = pNode->GetnodeTypedValue();
m_sServerAddr = server_addr;
}
// 중앙 서버의 Port 를 얻어 온다.
if(pNode = pConfig->selectSingleNode(L"./root/server_option/server_port"))
{
long nServerPort = pNode->GetnodeTypedValue();
m_iServerPort = nServerPort;
}
if(pNode = pConfig->selectSingleNode( L"./root/host_config/host_port" ))
{
long nHostPort = pNode->GetnodeTypedValue();
m_nHostPort = nHostPort;
}
if(pNode = pConfig->selectSingleNode( L"./root/host_config/player_on_player" ))
{
long nPlayerOn = pNode->GetnodeTypedValue();
m_nPlayerOn = nPlayerOn;
}
if(pNode = pConfig->selectSingleNode( L"./root/host_config/play_mode" ))
{
_bstr_t sPlayMode = pNode->GetnodeTypedValue();
m_sPlayMode = sPlayMode;
}
/////
MSXML2::IXMLDOMNodeListPtr pObjectList = pConfig->selectNodes(L"./root/host_db/character");
int nObject = pObjectList->Getlength();
for( int j = 0; j < nObject; j++ )
{
MSXML2::IXMLDOMNodePtr pNode;
MSXML2::IXMLDOMNodePtr pObject = pObjectList->Getitem(j);
pNode = pObject->selectSingleNode(L"./position/x");
m_vecPos[j].X = pNode->GetnodeTypedValue();
pNode = pObject->selectSingleNode(L"./position/y");
m_vecPos[j].Y = pNode->GetnodeTypedValue();
pNode = pObject->selectSingleNode(L"./position/z");
m_vecPos[j].Z = pNode->GetnodeTypedValue();
}
/////
if(pNode = pConfig->selectSingleNode( L"./root/client_option/connection_addr" ))
{
_bstr_t sConnectAddr = pNode->GetnodeTypedValue();
m_sConnectAddr = sConnectAddr;
}
//.........这里部分代码省略.........
示例15: LoadShootSolutionSet
void CShootManagerSys::LoadShootSolutionSet(SFullName nameFile)
{
int i;
MSXML2::IXMLDOMDocument2Ptr pDoc = NULL;
DFileGPack packFile;
packFile.Open(nameFile);
CFileSys::LoadBinaryXML(pDoc, packFile.GetFile(), packFile.GetSize());
packFile.Close();
// 시뮬레이터에서 사용하는 거리 범위들을 로드한다.
MSXML2::IXMLDOMNodeListPtr pNodeListDistance;
MSXML2::IXMLDOMNodePtr pNodeDistance;
float fDistance;
pNodeListDistance = pDoc->selectNodes(L"root/distance_range/distance");
for(i=0; i<pNodeListDistance->Getlength(); i++)
{
pNodeDistance = pNodeListDistance->Getitem(i);
_bstr_t distance = pNodeDistance->GetnodeTypedValue();
sscanf((LPCTSTR)distance, "%f", &fDistance);
m_DistanceList.push_back(fDistance);
}
// 시뮬레이터에서 사용하는 각도 범위들을 로드한다.
// 여기서 각도는 (골대 - 슈터) 와 양의 z 축 사이의 각도를 말한다.
// degree 로 저장되어 있으므로 Angle 로 변환시킨다.
MSXML2::IXMLDOMNodeListPtr pNodeListAngle;
MSXML2::IXMLDOMNodePtr pNodeAngle;
float fDegree;
int iAngle;
pNodeListAngle = pDoc->selectNodes(L"root/angle_range/degree");
for(i=0; i<pNodeListAngle->Getlength(); i++)
{
pNodeAngle = pNodeListAngle->Getitem(i);
_bstr_t degree = pNodeAngle->GetnodeTypedValue();
sscanf((LPCTSTR)degree, "%f", &fDegree);
iAngle = Degree2Angle(fDegree); // degree 에서 Angle 로 변환한다.
m_AngleList.push_back(iAngle);
}
// 전체 섹터 개수를 계산하고 여기에 맞게 메모리를 생성한다.
int iNumSector = m_DistanceList.size() * (m_AngleList.size() + 1) + 6;
for(i=0; i<iNumSector; i++)
{
ShootSolutionSector *pShootSolutionSector = new (m_ShootSolutionSectorArray) ShootSolutionSector;
}
// 각 섹터별로 섹터안의 Shoot Solution 들을 로드한다.
MSXML2::IXMLDOMNodeListPtr pNodeListSector = pDoc->selectNodes(L"root/sector");
MSXML2::IXMLDOMNodePtr pNodeSector;
MSXML2::IXMLDOMNodePtr pNodeIndex;
MSXML2::IXMLDOMNodePtr pNodePath;
for(i=0; i<pNodeListSector->Getlength(); i++)
{
pNodeSector = pNodeListSector->Getitem(i);
pNodeIndex = pNodeSector->selectSingleNode(L"index");
pNodePath = pNodeSector->selectSingleNode(L"path");
_bstr_t index = pNodeIndex->GetnodeTypedValue();
_bstr_t path = pNodePath->GetnodeTypedValue();
SString strName = (LPCTSTR)path;
DCutPath(strName);
DCutFileExt(strName);
strName[strName.Len()-3] = 'b';
int iIndex = atoi((LPCTSTR)index);
LoadShootSolutionSector(iIndex, SFullName("simulator",strName));
// int iIndex = atoi((LPCTSTR)index);
// SString sFilePath = szFilename;
// sFilePath = DGetPathOnly(sFilePath);
// sFilePath += "\\";
// sFilePath += (LPCTSTR)path;
// sFilePath.Format("%s\\%s\\%s", g_szCurrentPath, g_szSimulatorPath, (LPCTSTR)path);
// LoadShootSolutionSector(iIndex, (LPCTSTR)sFilePath);
}
CFileSys::UnloadXML(pDoc);
}