Ooops! I get a core dump when calling getNodeValue()
static string getNodeValue(DOMNode *node)
{
char*chNodeValue;
const XMLCh *nodeValue;
string str;
if (node)
{
nodeValue = node->getNodeValue();
chNodeValue = XMLString::transcode(nodeValue);
> Depending on the contents of a node, this could be a lot of string copying.
Hmm, this is not high performance.
So, it entirely depends on what you are attempting to do...
Actually, I just want to assign the node value to a string variable:
string nodeValue; // the value should be stored here
[EMAIL PROTECTED]
cc:
03/27/2003 11:28 Subject: Re: DOM nodeValues:
Thanks a lot for the fast reply!
I have now:
static string getNodeValue(DOMNode *node)
{
char*chNodeValue;
const XMLCh *nodeValue;
string str;
if (node)
{
nodeValue = node->getNodeValue();
chNodeValue = XMLString::transcode(nodeValue);
str = chN
cc:
03/27/2003 10:29 Subject: 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
static char *getNodeValue(DOMNode *node)
{
char*chNodeValu