1

我已经多次查看 Poco SAX 解析器头文件,但似乎找不到任何有关如何获取元素内部文本的信息。例如:

<description>This is the inner text.</description>

谁能指出我正确的方向?

4

1 回答 1

1

好的,自己找到了解决方案。我需要像这样实现“字符”方法:

void MyParser::characters(const Poco::XML::XMLChar ch[], int start, int length)
{
  std::string innerText = std::string(ch + start, length);
}
于 2009-09-26T14:34:58.173 回答