1

I've the following xml file inside the /mnt/sdcard. I want to get the version of the item type=provider from the following file. The file is big(500 lines) which has othere types also. This is simplified file. In the file I'm intetersted in this node:

<Item Type="Provider" Version="19.0.0.0"Checksum="EShHVeNtW1xTfEvLvATwqA==" FileSize="2746200" />

From this node I want to get the version i.e. 19.0.0.0.

Here is my xml file:

<Manifest guid="FD29E1EF-A5C4-4D19-ACC8-8C98C7E91B02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" PackageType="Full" Scope="APPROVED">
   <Items>
        <Item id="fcxm-8ikj-olk-ffgcxh3" Checksum="EShHVeNtW1xTfEvLvATwqA==" value="f425921f-b6ef-4e58-8a14-fcbd0d7e50e9" />
        <Item Type="question" Version="19.0.0.0"Checksum="EShHVeNtW1xTfEvLvATwqA==" FileSize="2746200" />
        <Item Type="Provider" Version="19.0.0.0"Checksum="EShHVeNtW1xTfEvLvATwqA==" FileSize="2746200" />
    </Items>
</Manifest>

I'm using Java code to develop my android application. I searched on the internet, I got this which is iterating to all the nodes of item type. I dont want want to iterate.

Community
  • 1
  • 1
Jainendra
  • 24,713
  • 30
  • 122
  • 169

1 Answers1

2

in android we have three normal way to parse xml, XmlPullParser, SaxXmlPullParser, DocumentBuilder(DOM parser), and android use XmlPullParser for android resource parser.

Sahil Mahajan Mj
  • 11,033
  • 8
  • 53
  • 100
ila123
  • 36
  • 1
  • thanks for the reply, can u please tell me which would be good specific to this example, and how to read the file? – Jainendra Dec 27 '12 at 09:22