1
我一直在瀏覽Poco SAX解析器頭文件幾次,但我似乎無法找到關於如何獲取元素的內部文本的任何信息。例如:Poco C++ SAX解析器:如何獲取元素「內部文本」?
<description>This is the inner text.</description>
任何人都可以指向正確的方向嗎?
我一直在瀏覽Poco SAX解析器頭文件幾次,但我似乎無法找到關於如何獲取元素的內部文本的任何信息。例如:Poco C++ SAX解析器:如何獲取元素「內部文本」?
<description>This is the inner text.</description>
任何人都可以指向正確的方向嗎?
好的,我自己找到了解決方案。我需要使用像這樣的'字符'方法:
void MyParser::characters(const Poco::XML::XMLChar ch[], int start, int length)
{
std::string innerText = std::string(ch + start, length);
}
謝謝。研究Poco XML解析。 – kometen 2016-03-08 12:59:13