易截截图软件、单文件、免安装、纯绿色、仅160KB
热门标签: c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 最新文章 :

DataSet 读取xml文件

 DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath(NetShop.Config.DbConfigs.GetSitePath + "images/flashdata/flash.config"));
DataRow[] drs = ds.Tables[0].Select("", "[SortOrder] ASC");
//返回的是个DataRow[]:
//DataRow[] dr=ds.Tables("FindFeatureOutputTable").Select("id>100")
//object[] aArray = new object[intColumns];
//dr.ItemArray.CopyTo(aArray, 0);
//dt.Rows.Add(aArray);
//然后绑定dt.注意,上面的intColumns应该为dt的Column的Count.
//DataView DV = ds.Tables("FindFeatureOutputTable").DefaultView;
//DV.RowFilter = "id>100";
//Dg1.DataSource = DV;
string sitewebpath = NetShop.Config.DbConfigs.GetSitePath;
for (int i = 0; i < drs.Length; i++)
{
if (i > 3)
......

Symbian OS下解析XML文档的一些方法

2009-10-27 22:44资料来源于网络,四种方式,大家可以自己尝试下.
=========11111=================
tinyXML
www.grinninglizard.com/tinyxml/
=========22222================================
symbian s60 第三版之后,已经提供了解析xml的系统api,采用的是SAX方式。
XML parsing in Symbian OS v9.x 来源目录:
http://wiki.forum.nokia.com/index.php/XML_parsing_in_Symbian_OS_v9.x
Use the XML Parser in OS 9.x ::::::
http://blogs.forum.nokia.com/index.php?op=ViewArticle&blogId=1412&articleId=475
===>
http://www.forum.nokia.com/Technical_Library/FNTL/fn_technical_library.htm
TSS000286 - Using the XML parser in S60 ====>
http://wiki.forum.nokia.com/index.php/TSS000286_-_Using_the_XML_parser_in_S60
and search for CParser or ========>
http://wiki.forum.nokia.com/index.php/TSS000286_-_Using_the_XML_parser_in_S60
How to parse XML file using CParser class=====>
http://wiki.forum.nokia.com/index.php/How_to_parse_XML_file_using_CParser_class
Symbian学习笔记(15) - 解析XML文件(上) ......

Symbian学习笔记(15) 解析XML文件(上)

收藏
我曾在前面介绍过一个可用于BREW环境下的XML Parser,今天想分享的是如何在Symbian平台上解析XML文件,不需要第三方的东西,Symbian已经为我们提供了这个类CParser。
网上也有这方面的资料,建议参考:
http://wiki.forum.nokia.com/index.php/How_to_parse_XML_file_using_CParser_class
不过,要注意的是Symbian中的CParser是基于SAX方式来解析的也就是说它是基于事件流方式,对于SAX,如果做过JAVA开发的一般不会陌生了。与DOM相比SAX方式在操作上会有点麻烦而且显得没那么好理解。
简要比较一下吧,DOM是将XML在内存中展开成一个树的模型,我们可以方便地访问它的每个子节点,可读可写。但是SAX呢?我们只能通过一个单向文本流去解析XML,在过程中有多个事件回调(开始某个元素处理、结束某个元素处理等等),它是单向只读的。
下面我们来详细说明一下如何实现吧。
首先,我们建立一个解析器派生于CActive,由它负责整个解析过程(因为这是一个异步操作)。
#include <xmlparser.h>
#include <xmlcontenthandler.h>
using namespace Xml;
class MXMLHandlerObserver
...{
public:
    virtual void OnParseCompleted( TIn ......

Symbian学习笔记(16) 解析XML文件(下)


字号:  小  中  大  | 打印 发布: 2009-1-08 16:33    作者: webmaster    来源: 本站原创    查看: 40次
书接上回,这篇介绍那个MContentHandler的实现,这是SAX解析方法的核心所在。
先看看我要解析的XML文件如下所示,其实很简单,因为它除了Element和Attribute以外没有其它东西了。
<?xml version="1.0" encoding="utf-8" ?>
<channels>
<channel id="10" title="时政" >
<content id="1001" title="广东牛奶中毒事件污染源调查结果1周后公布"/>
<content id="1002" title="河南淅川公安局因儿童被拐案设'局耻日'"/>
<content id="1003" title="深圳大学135名师生感染病毒引发腹泻"/>
</channel>
<channel id="11" title="国际">
<content id="1101" title="巴以将于4月7日恢复领导人级和谈"/>
<content id="1102" title="古巴解除长期禁令允许国民入住涉外酒店"/>
<content id="1103" title="联合国决定继续对刚果(金)实行武器禁运"/>
<content id="1104" title="俄拒绝接受美国进攻性战略武器问题建议"/> ......

How to parse XML file using CParser class


Reviewer Approved    
The following example shows how to parse XML file using Symbian OS C++ class, CParser. CParser is basically a SAX (Simple API for XML)-based XML parser.
It uses an active object to read the XML file chunk by chunk (see CXmlHandler::StartParsingWithAoL() method). On each chunk, it passes the buffer to the XML parser. When the XML parser finds an element, it calls the respective callback functions, for example CXmlHandler::OnStartElementL() or CXmlHandler::OnEndElementL().
To use CParser class, the XmlFramework.lib has to be included in the .mmp file. For more information about CParser, please visit some links at the end of this page.
Contents
[hide]
 1 XmlHandler.h
 2 XmlHandler.cpp
 3 download example
 4 See Also
[edit] XmlHandler.h
#ifndef __XMLHANDLER_H__
#define __XMLHANDLER_H__
 
// INCLUDE FILES
#include <e32base.h>
#include <f32file.h>  // ......

Use the XML Parser in OS 9.x


Paul.Todd | 09 April, 2007 15:24
I have noticed a couple of people seem to be having problems with using the XML parser in Symbian and there are no examples outside of the devkit. The parser I will be talking about is the xml one, not the one SOAP engine as the SOAP one is Nokia specific.
The key to parsing XML is to understand how SAX based parsing works.
The key to using the Symbian XML API is to understand how SAX works and how its been implemented in Symbian.
SAX is at its core an event driven model that supports data being streamed, making it ideal for devices.
The foundation of the parser is the MContentHandler class which provides the callback interface you need to implement. In fact the first thing you need to do is to create a class deriving from MContentHandler that implements all of the pure virtual methods of MContentHandler
You can then create a CParser class and use your implementation of MContentHandler to provide the call backs required. You will normally only ......
总记录数:40319; 总页数:6720; 每页6 条; 首页 上一页 [2197] [2198] [2199] [2200] 2201 [2202] [2203] [2204] [2205] [2206]  下一页 尾页
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号