Overview
Features
Download
Documentation
Community
Add-Ons & Services

SAX: how to get element "inner text"?

Please post support and help requests here.

SAX: how to get element "inner text"?

Postby francisr » 24 Sep 2009, 21:49

I've been going over the 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:

Code: Select all
<description>This is the inner text.</description>


Can anyone point me in the right direction?

Thanks in advance.
Francis
francisr
 
Posts: 21
Joined: 09 Dec 2007, 13:19

Re: SAX: how to get element "inner text"?

Postby francisr » 26 Sep 2009, 16:29

Ok, found the solution myself. I needed to use implement the 'characters' method like this:

Code: Select all
void Parser::characters(const Poco::XML::XMLChar ch[], int start, int length)
{
  std::string innerText = std::string(ch + start, length);
}


Grts,
Francis
francisr
 
Posts: 21
Joined: 09 Dec 2007, 13:19


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron