Wince MSXML3.0 解析错误

从上周五开始在WinCE6.0平台下使用MSXML3.0来解析XML格式的配置文件,但是出现一个很莫名其妙的问题,就是使用xDocument->SelectNodes一直不成功,但是使用xDocument->get_xml查看得到的整个文件的xml文本时发现都是正确的,所以百思不得其解。

后来,Goole了很多文档,终于查到(http://blogs.msdn.com/b/cenet/archive/2005/09/01/459476.aspx):

A common error some Windows CE developers hit when using MSXML is that they call into some functionality and they get a not implemented error (E_NOTIMPL=0x80004001) when the CE Docs say the feature is supported.  In particular, people hit this a lot when doing a query (xmlDom.selectNodes(), selectSingleNode(), getElementsByTagName()) or when transforming nodes (xmlDom.transformNode).

The problem is that the CE MSXML is extremely componentized, such that you only get the particular features that you want.  So you may have built an MSXML with the DOM feature only, not the additional features you need to make the above calls work, and hence E_NOTIMPL.  For querying XML, you need to have your image built with SYSGEN_MSXML_XQL.  For transforming nodes, you'll also need SYSGEN_MSXML_XSLT.

This problem is easy to fix if you're an OEM, a little trickier if you're an ISV working with an OEM.  (This problem doesn't affect PocketPC / Smartphone developers in the first place for various reasons.)  See here  for information about how you can add system level components to your device.

原文不翻译了,大概的意思是,要使用SelectNodes等查询方法,那么必须将SYSGEN_MSXML_XQL组件加入,不然无法查询。

 

2010.12.15 追加

但是,如果在WinCE6.0的模拟器上运行的话,还是不成功。如果换成实际设备,则没有问题。到时候花点时间看看到底是什么问题。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值