2011-01-28 14 views
5

私はSencha touchを使ってアプリケーションを開発しようとしています。私が今直面している問題は、Senchaのコードは、以下のXML( "data.xml"と表示ニュース、記事...)を読んで、ここで助けてくれるエキスパートですか?Senchaを使ってXMLを読む

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

そして私は、一例として、ニュースをクリックしてください.theのdata_read.xmlがどのように見える「data_read.xml」と表示「origUrl」、「タイトル」、「データ」には、特定の「レコードID」の要素をお読みください下に..

<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で可能ですか?

答えて

0

Ext.data.XmlReaderクラスをチェックアウトし、それは何が必要ない場合は以下を参照してください

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

+0

はい私はそれをチェックしてxmlファイルを読むことができますが、次のxmlファイルを読み込もうとすると問題が発生します... – user580950

+0

あなたの投稿にエラーを追加してください –

0

私はXMLリーダーが適切にCDATA(CDATA hereについて読む)構文解析を処理しますがされていない疑いがあります後でそれを見る必要があります。可能な代替策は、xmlを準備してCDATAを除去することです。

関連する問題