使用诺基亚论坛 - Symbian C++ 中的 XmlHandler 类读取 XML 文件

发布于 2024-09-09 02:14:32 字数 494 浏览 1 评论 0原文

我正在尝试使用 XmlHandler 类( 使用 XmlHandler 类代码链接到诺基亚论坛 ) 在 Symbian S60 3rd FP2 版本上读取 xml 文件。我的函数中有这段代码:

CXmlHandler *iXmlHandler;
TFileName fileName;

iXmlHandler = CXmlHandler::NewL();
fileName.Append( KConfigFile );
iXmlHandler->StartParsingWithAoL( fileName );

但我不知道如何使用 KConfigFile 中的数据...
谁能告诉我如何从 XML 文件中读取节点并使用节点中的数据?

I'm trying to use XmlHandler class ( link to Forum Nokia with code of XmlHandler Class ) on Symbian S60 3rd FP2 edition to read xml files. I have in my function this code:

CXmlHandler *iXmlHandler;
TFileName fileName;

iXmlHandler = CXmlHandler::NewL();
fileName.Append( KConfigFile );
iXmlHandler->StartParsingWithAoL( fileName );

But I don't know how to use data from KConfigFile...
Can anybody tell me how I can read nodes from my XML file and use data from nodes?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

笑,眼淚并存 2024-09-16 02:14:32

该示例是一个正常的完整 SAX 解析器。您将节点作为回调获取,因此您需要将逻辑添加到 OnStartElementL。

That example is a normal complete SAX parser. You get your nodes as callbacks, so you need to add your logic to OnStartElementL.

有木有妳兜一样 2024-09-16 02:14:32

您需要向各种 OnStart* 和 OnEnd* 成员函数添加代码。
解析器将在处理文件时按顺序调用这些函数。
函数的参数将包含有关打开和关闭哪个标签的信息。
如果您想存储任何已解析的信息,您可以在这些函数中执行此操作。

You need to add code to the various OnStart* and OnEnd* member functions.
The parser will call these functions in order as it proceeds through the file.
The arguments to the functions will contain the information about what tag is opening and closing.
If you want to store any of the parsed information it is up to you to do so in these functions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文