Where is the buffer(string) allocated which is returned by the XMLCh pointer
of the getNodeValue() function?  Do I have to provide my own buffer, like I
do below, to copy the contents of the returned string into?  Or could I just
return the XMLCh pointer from my GetElementValue() method?

BOOL CDOMParser::GetElementValue(const XMLCh* wszTagName, CString&
strTagValue, const DOMElement* pParentDOMElement)
{
        ASSERT(pParentDOMElement);
        if (pParentDOMElement)
        {
                DOMNodeList* pDOMNodeList =
pParentDOMElement->getElementsByTagNameNS(NULL, wszTagName);
                if (!pDOMNodeList || pDOMNodeList->getLength() < 1)
                        return FALSE;

                DOMNode* pDOMNode = pDOMNodeList->item(0);
                if (pDOMNode)
                {
                        DOMNode* pChildNode = pDOMNode->getFirstChild();
                        if (pChildNode)
                        {
                                // What is the scope of the buffer(string) returned by 
this pointer?  Do
I have
                                // to copy this into my buffer which is passed in by 
reference?
                                XMLCh* wsz = pChildNode->getNodeValue();
                                strTagValue = wsz;
                        }
                }

                return TRUE;
        }

        return FALSE;
}



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to