Example Code of Using XML Parser in Symbian OS

antonypr | 14 April, 2007 00:05
A couple of weeks ago, I had a plan to write an article and example code of using XML parser in Symbian OS. It seems that another Forum Nokia Champion, Paul Todd had the same idea. He posted a nice article about XML parser in Symbian OS 9.x to Forum Nokia Blogs. It's good that I don't need to write the same article. :)

What I would like to share here is a complete example code of XML Parser in Symbian OS. The example code can be run on Symbian OS 8 and 9 phones, which means it can be compiled under S60 2nd Edition FP2/FP3 SDK or S60 3rd Edition SDK. I am planning to release the same example code for UIQ3 soon.

Click here to download my example code of XML parser


The example  basically parses an XML file, dataexample.xml, to the main window. The content will be displayed on CEikEdwin control (see picture below).

 

Note that the code is written as an example; thus it is designed to be as simple as possible. Do not use it in the production code!

One more thing, this is not the official example code from Forum Nokia. It is just my personal example code.
 S60, Symbian C++ |  Next |  Previous |  Comments (11) |  Trackbacks (0)
 Comments
Re: Example Code of Using XML Parser in Symbian OS
sandordornbush | 17/05/2007, 20:52
This is great starting point. However I need to parse a fairly large file (~8kB). Can you give any advice how to adapt this code to one where the whole file does not need to be loaded in one shot? I also posted this on the forums at:
http://discussion.forum.nokia.com/forum/showthread.php?t=108183
Re: Example Code of Using XML Parser in Symbian OS
jp4symbian | 13/06/2007, 15:26
This is an extremely useful example for parsing Xml specially since there is no such example on Forum.Nokia.

I have studied your example and have been able to successfully parse my Xml. But I also need to parse the tag attributes which is not implemented in your example.

I assume that attributes of a tag will be obtained in the function:
OnStartElementL(const RTagInfo& aElement, const RAttributeArray& aAttributes, TInt aErrorCode)

But I am not getting the attributes in the second argument viz. aAttributes. When I debug, I get value for this argument as: CXX0072: Error: type information missing or unknown

Can you please let me know how to fetch the attributes of an Xml tag?
How should I write my Xml so as to get the attributes identified?
For e.g., do the attribute values have to be placed within inverted commas etc.

Kindly help me with this.
Re: Example Code of Using XML Parser in Symbian OS
jp4symbian | 14/06/2007, 11:01
This is an example code for S60 2nd Edition FP2/FP3 and S60 3rd Edition as per your documentation.

What is the alternative for S60 2nd Edition (v2.0) and FP1(v2.1) phones?

The header files that you have used in your example are not present in the 2nd Edition and FP1 SDKs.
But when I checked the Nokia 6670 handset, it does contain the xmlframework.dll ! Then why does the corresponding SDK not have the Xml headers?

Can you please put some light over this issue.

Please let me know the solution since I am targeting all S60 phones above 1st Edition and below 3rd Edition.

Thanking you in anticipation.
Re: Example Code of Using XML Parser in Symbian OS
namanrules | 06/02/2008, 08:56
Great post. Can you please also point us about how to parse wbxml document using plugins provided by framework.
Thanks
Re: Example Code of Using XML Parser in Symbian OS
saimram | 27/02/2008, 10:42
Hi,
Thank you for provding an insight of how to parse the XML file..
But i have a doubt that is when i run the test with some other content in the example.xml, it is not displaying the content that is there in the file on to the screen, instead of that it is still showing the same old content of xml file which was there when we download the file, How can rectify this defect..
Why the file cannot be downloaded?
TESTSDK30 | 15/05/2008, 05:55
It seems the file is not available, could you please help to check?
I can't download this file
cwyhs001 | 14/08/2008, 09:45
hi,
i can't download the code of XML parser. can you send me a copy of this code to me.
e-mail:cwyhs001@hotmail.com
thanks
Extracting content to a variable
dele2006 | 29/08/2008, 19:49
Hi,
I have downloaded and used your example.
I have an XML document with the following element.
venus
I can get the element name port using
aElement.LocalName().DesC().
The problem is that i want to extract the content to use in my application.
i.e port_name = venus ...
How do i extract the content name ? I am using a console application.
Thanks
Help Needed!!!IHow to code an XML file
sarah_r | 25/09/2008, 08:02
Hi,
I'm new to Symbian development. I would appreciate it,if you would let me know how to code a simple XML file. I would like to know the steps,how to go about creating an XML file.
Thanks & Regards
Please send the XML parser example to me
happyson | 26/03/2009, 10:21
I study the XML parser,but I haven't find the suitable resource, I need some help, Thanks.
can I use this for 5th Edition ?
sunitha.m13 | 22/10/2009, 09:01
Hi,
I have successfully run the code for S60 3rd Edition.
I want to develop the code for 5th Edition.
Is it compatible for 5th Edition also ?
I am getting the errors like :
Thread MyXmlParser.exe::Main created @ 0xd04c5d0 - Win32 Thread ID 0x384
Thread MyXmlParser.exe::Main Killed -4
Please suggest me...
Thanks & Regards,
Sunitha.M

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值