如何解析android中的xml文件(在dom解析器中)

时间:2014-01-01 19:21:53

标签: android xml

这是我从我的网站服务(asp.net)返回的XML(由我自己设计)         我是我需要的android编程的新手        日期        时间        rahbar1        rahbar2数据请帮帮我**

我不知道该怎么做

     <DataSet>
     <xs:schema id="NewDataSet">
     <xs:element name="NewDataSet" msdata:IsDataSet="true"  msdata:UseCurrentLocale="true">    
    <xs:complexType>
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Table">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="date" type="xs:string" minOccurs="0"/>
    <xs:element name="time" type="xs:string" minOccurs="0"/>
    <xs:element name="rahbar1" type="xs:string" minOccurs="0"/>
    <xs:element name="rahbar2" type="xs:string" minOccurs="0/>   
    <xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:choice>
    </xs:complexType>
    </xs:element>
     </xs:schema>
    <diffgr:diffgram>

    <NewDataSet>
    <Table diffgr:id="Table1" msdata:rowOrder="0">
    <date>1392/10/1</date>
    <time>05:40</time>
    <rahbar1>پورقاسمي,مهدي</rahbar1>
    <rahbar2>خرسندي كلور,احمد</rahbar2>
    </Table>
    <Table diffgr:id="Table2" msdata:rowOrder="1">
    <date>1392/10/1</date>
    <time>05:40</time>
    <rahbar1>پورقاسمي,مهدي</rahbar1>
    <rahbar2>خرسندي كلور,احمد</rahbar2>**
    </Table>
    <Table diffgr:id="Table3" msdata:rowOrder="2">
    <date>1392/10/1</date>
    <time>21:30</time>
    <rahbar1>خرسندي كلور,احمد</rahbar1>
    <rahbar2>پورقاسمي,مهدي</rahbar2>
    </Table>
    <Table diffgr:id="Table4" msdata:rowOrder="3">
    <date>1392/10/1</date>
    <time>21:30</time>
    <rahbar1>خرسندي كلور,احمد</rahbar1>
    <rahbar2>پورقاسمي,مهدي</rahbar2>
    </Table>
    </NewDataSet>

1 个答案:

答案 0 :(得分:0)

此文件的编码是什么?

在你的结构中尝试这样的编码:

在您的文档/数据的开头。

Refer this "DOM parser in Arabic"