As Mr.Alberto told if we iterate the child nodes instead of using
getElementsByTagNameNS it will be efficient.
Please find the code snippet for the same.....
Regards,
Swaminathan
// Get all the child nodes of the given Document's root node.
XERCES_CPP_NAMESPACE::DOMNodeList* pDOMNodeList =
m_pDocument->getDocumentElement()->getChildNodes();
if(0 == pDOMNodeList)
{
return ERR_DOM_OPERATION_FAILED;
}
// Loop over all child nodes
for(int nIndexChild=0; nIndexChild < pDOMNodeList->getLength();
nIndexChild++)
{
XERCES_CPP_NAMESPACE::DOMNode* pDOMNode =
pDOMNodeList->item(nIndexChild);
if(pDOMNode == 0)
{
continue;
}
//Check whether the node is the element node.
if(XERCES_CPP_NAMESPACE::DOMNode::ELEMENT_NODE !=
(XERCES_CPP_NAMESPACE::DOMNode::NodeType)pDOMNode->getNodeType())
{
//Node is not an element node continue with the next
node
continue;
}
XERCES_CPP_NAMESPACE::DOMNodeList* pDOMNodeList1 =
pDOMNode->getChildNodes();
if(0 == pDOMNodeList1)
{
return ERR_DOM_OPERATION_FAILED;
}
// Loop over all child nodes
for(int nIndexChild1=0; nIndexChild1 <
pDOMNodeList1->getLength(); nIndexChild1++)
{
XERCES_CPP_NAMESPACE::DOMNode* pDOMNode1 =
pDOMNodeList->item(nIndexChild1);
if(pDOMNode1 == 0)
{
continue;
}
//Check whether the node's name is same as the given
node name.
CString cstrCurrNodeName = pDOMNode1->getNodeName();
if(0 != cstrNodeName.CompareNoCase(_T("CbName")))
{
//Node name does'nt match continue with the
next node
continue;
}
CString cstrCurrNodeValue =
pDOMNode1->getNodeValue();
CString cstrNodeValue = m_wstrColorbarName.c_str()
if(0 == cstrNodeValue
.CompareNoCase(cstrCurrNodeValue ))
{
//Do here what to be done...
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]