You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by "Johnston, Nigel" <ni...@intel.com> on 2002/06/13 22:29:06 UTC

Converting from XalanDOMString to std::string

What is the prefferred (efficient) way to convert from a XalanDOMString to a
std::string?

I'm currently doing the following, but I'm sure there's a better way..

	const XalanDOMString& s = node->getNodeName();
	ostringstream ost;
	ost << s.c_str();
	return ost.str();

I see that there is a transcode function that can give me a vector<char>,
but I still then have to create a string and copy in the vector contents.

thanks,