Poco C++ SAX parser: how to get element “inner text”?
Question
I've been going over the Poco SAX parser header files a few times but I can't seem to find any info on how to obtain an element's inner text. For example:
<description>This is the inner text.</description>
Can anyone point me in the right direction?
Solution
Ok, found the solution myself. I needed to use implement the 'characters' method like this:
void MyParser::characters(const Poco::XML::XMLChar ch[], int start, int length)
{
std::string innerText = std::string(ch + start, length);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow