加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

使用Sencha读取XML

发布时间:2020-12-16 23:27:45 所属栏目:百科 来源:网络整理
导读:我即将使用Sencha touch开发应用程序.我现在面临的问题是Sencha代码应该读取以下 XML(“data.xml”并显示新闻,文章…),任何可以帮助的专家都可以吗? ns2:categoriescategory catId96/catId titleNews/title/categorycategory catId97/catId titleArticles/t
我即将使用Sencha touch开发应用程序.我现在面临的问题是Sencha代码应该读取以下 XML(“data.xml”并显示新闻,文章…),任何可以帮助的专家都可以吗?

<ns2:categories>
<category>
 <catId>96</catId>
 <title>News</title>
</category>
<category>
 <catId>97</catId>
 <title>Articles</title>
</category>
</ns2:categories>

当我点击News作为示例时,应该读取“data_read.xml”中的特定“recordId”元素并显示“origUrl”,“title”,“data”.the data_read.xml如下所示.

<ns2:records>
<record>
<recordId>96</recordId>
<title>123 Lifted</title>
<author>|</author>
<published>2010-01-20T14:36:00.000-08:00</published>
<origUrl>
http://www.abc.com/</origUrl>
<numComments>0</numComments>
<data>
<![CDATA[<p>According to a report on sd asdas das asdasd  asdasd hjjasd .</p>
<p> </p>
<p>This is a landmark vote,and a harbinger of change for this extremely traditional area that also has banned the use of metal r bolt.</p>
<p> </p>
<p>Check out: abc.com and xyz .com for more information.</p>
<p class="modifydate">Last Updated (Wednesday,20 January 2010 22:36)</p>]]>
</data>
</record>
</ns2:records>

Sencha有可能吗?

解决方法

查看Ext.data.XmlReader类,看看它是否能满足您的需求:

http://dev.sencha.com/deploy/touch/docs/?class=Ext.data.XmlReader

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读