In DOM, the DOMElement doesn't have a value; what you see as 111_2 in
the source XML is really a DOMText node, children of the DOMElement one.
You should test if pNode->getFirstChild() is not NULL, if its
getNodeType() returns DOMNode::TEXT_NODE, and then get its getNodeValue().
Alberto
[email protected] wrote:
Hi All,
I have a node like this <SourceID>111_2</SourceID> . I am able to read
the node name viz,
SourceID. I am not able to read value viz, 111_2..
My this part of code looks like this :
DOMNodeList *pNodeList = pDocument->getElementsByTagName(L"SourceID");
DOMNode *pNode = pNodeList->item(0);
const char* csNodeName = (const char*)
XMLString::transcode(pNode->getNodeName());
const char* csNodeValue = (const char*)
XMLString::transcode(pNode->getNodeValue());
I am able to read the node name but I am not getting the value.
Environment : Windows 2000, VC++ 6.0, Xerces 2.7
Kindly help me to resolve the issue.
Thanks,
Krishna
Confidentiality Notice
The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of
the addressee(s) and may contain confidential or privileged
information. If you are not the intended recipient, please notify
the sender at Bharat Electronics or [email protected] immediately
and destroy all copies of this message and any attachments.