0

オンライン Web サイト用にいくつかのフラッシュ ファイル (.xml) を作成しました。今、私は自分の Android アプリの xml ファイルにそのデータが必要です。どうすればそれを達成できますか。xml ファイルは、ほとんど適切な形式で、きれいに、適切に記述されています。これは、他のすべての also.thnx とほとんど同じであるその xml ファイルの小さなコードです。

<slide id="2" template="listeningStayMultiText">
    <images>
        <image direction="Right" xCord="100" yCord="170"><![CDATA[images/common/1x1.gif]]></image>
    </images>
    <sentences>
        <sentence index="1"  fontColor="0x000000"  width="600" height="70" size="18" xPos="50" yPos="20" bgColor="0xDBEFDF" borderColor="0x006600" align="left"><![CDATA[<br/>  Let’s look at how we make negative sentences in the simple present tense -]]></sentence>
        <sentence index="2"  fontColor="0xffffff"  width="300" height="60" size="18" xPos="50" yPos="100" bgColor="0x006600" borderColor="0x000000" align="center"><![CDATA[<br/>POSITIVE SENTENCE]]></sentence>
        <sentence index="3"  fontColor="0xffffff"  width="300" height="60" size="18" xPos="350" yPos="100" bgColor="0x006600" borderColor="0x000000" align="center"><![CDATA[<br/>NEGATIVE SENTENCE]]></sentence>
        <sentence index="4"  fontColor="0x000000"  width="300" height="120" size="18" xPos="50" yPos="160" bgColor="0xDBEFDF" borderColor="0x000000" align="center"><![CDATA[<br/>I play football]]></sentence>
        <sentence index="5"  fontColor="0x000000"  width="300" height="120" size="18" xPos="350" yPos="160" bgColor="0xDBEFDF" borderColor="0x000000" align="center"><![CDATA[<br/>I <b>do not</b> play football<br/>OR<br/>I <b>don't</b> play football]]></sentence>
        <sentence index="6"  fontColor="0x000000"  width="600" height="90" size="18" xPos="50" yPos="300" bgColor="0xDBEFDF" borderColor="0x000000" align="center"><![CDATA[<br/>We use '<b>do not</b>' or '<b>don’t</b>' with ‘&lt;b>I</b>’ to make negative sentences in the simple present tense.]]></sentence>
    </sentences>
    <audio><![CDATA[images/common/silence.mp3]]></audio>        
    <bgImage><![CDATA[images/bg.jpg]]></bgImage>
</slide>
4

1 に答える 1

0

Simpleフレームワークを見てください

データモデルに注釈を使用し、実装が非常に簡単です。あなたの場合、それは次のようになります

@Root
public class Slide {
    @Attribute
    public int id;
    @Attribute
    public String template;
    @ElementList
    public List<Images> image;
    @ElementList
    public List<Sentence> sentences;

}

等...

于 2012-08-24T11:57:07.370 に答える