You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Andreas B. Thun" <ab...@gmx.net> on 2003/03/27 16:29:18 UTC

DOM nodeValues: char* to string

Hi!

I am using the following function to retrieve
DOM-node values. But I want to return not (char *),
but a STL string value. How can I do it?

Sorry for that C++ newbie request.
Used to be a C programmer ....
:-)

TIA


#include <string>


static char *getNodeValue(DOMNode *node)
{
    char        *chNodeValue;
    const XMLCh *nodeValue;

    if (node)
    {
       nodeValue = node->getNodeValue();
       chNodeValue = XMLString::transcode(nodeValue);
       // cout << "  '" << chNodeValue << "' " << endl;
    }
    return(chNodeValue);
}  // getNodeValue()


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org