Hello,
getChildNodes() function always returning null pointer. When I am looking at User Groups mails, Dave mentioned, to use getFirstChildNod() instead of getChildNodes.
My question is, if my XPATH expr is RESPONSE/ROUTCTL, in my program, I have to return its not a LEAF_TAG/ something. if my Xpath is RESPONSE/ROUTCTL/MSGNO, then I have to return value 'BULK'. How can we do it?
<RESPONSE>
<ROUTCTL>
<MSGNO>BULK</MSGNO>
<RSYS>RECEIVER</RSYS>
<TMST>20040908.123426</TMST>
<TSYS>NCON</TSYS>
</ROUTCTL>
</RESPONSE>
<ROUTCTL>
<MSGNO>BULK</MSGNO>
<RSYS>RECEIVER</RSYS>
<TMST>20040908.123426</TMST>
<TSYS>NCON</TSYS>
</ROUTCTL>
</RESPONSE>
XalanNode *pNode = (XalanNode*)xalanNodeReflist.item(aIndex);
XalanNode *pChild = pNode->getFirstChild();
if(pChild != 0 &&
pChild->getNodeType() != XalanNode::TEXT_NODE )
{
return NOT_LEAF;
}
DOMServices::getNodeData( *pNode, xalanDomstring);
XalanNode *pChild = pNode->getFirstChild();
if(pChild != 0 &&
pChild->getNodeType() != XalanNode::TEXT_NODE )
{
return NOT_LEAF;
}
DOMServices::getNodeData( *pNode, xalanDomstring);
So, In our XML, there is sapce after ROUTCTL, so getFirstChild is alwways returns TEXT_NODE.
If we have getChildNodes(), we can do it what ever we want, by check each node type.
I am new to XML Technologies, Please let me know.
Thanks in adavance.
Cheluus
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
