我有以下格式的xml
<Report name="MotionSummary" type="device.detail" format="xml">
<Account>sysadmin</Account>
<TimeFrom timestamp="1394044200" timezone="GMT+05:30">2014/03/06,00:00:00</TimeFrom>
<TimeTo timestamp="1394130540" timezone="GMT+05:30">2014/03/06,23:59:00</TimeTo>
<ValidGPSRequired>false</ValidGPSRequired>
<SelectionLimit type="FIRST">4000</SelectionLimit>
<Ascending>true</Ascending>
<ReportLimit>1000</ReportLimit>
<Title>Driving/Stopped Time Summary [Based on 0 Minute Minimum Stop]</Title>
<Subtitle>Honda City [mh-31-cr-0742]\n'2014/03/06' through '2014/03/06
23:59:00' [GMT+05:30]</Subtitle>
<ReportHeader>
<HeaderRow class="rptHdrRow">
<HeaderColumn id="index" class="rptHdrCol_nosort">#</HeaderColumn>
<HeaderColumn id="startdatetime" class="rptHdrCol_nosort">Start\nDate/Time</HeaderColumn>
<HeaderColumn id="drivingelapse" class="rptHdrCol_nosort">Driving\nElapsed</HeaderColumn>
<HeaderColumn id="odomdelta" class="rptHdrCol_nosort">Driven\nKm</HeaderColumn>
<HeaderColumn id="stopdatetime" class="rptHdrCol_nosort">Stop\nDate/Time</HeaderColumn>
<HeaderColumn id="stopgeopoint" class="rptHdrCol_nosort">Lat/Lon</HeaderColumn>
<HeaderColumn id="stopaddress" class="rptHdrCol_nosort">Address</HeaderColumn>
<HeaderColumn id="idleelapse" class="rptHdrCol_nosort">Trip Idle\nElapsed</HeaderColumn>
<HeaderColumn id="stopelapse" class="rptHdrCol_nosort">Stopped\nElapsed</HeaderColumn>
</HeaderRow>
</ReportHeader>
<ReportBody>
<BodyRow class="rptBodyRowOdd">
<BodyColumn id="index" class="rptBodyCol">1</BodyColumn>
<BodyColumn id="startdatetime" class="rptBodyCol">2014/03/06 09:41:38</BodyColumn>
<BodyColumn id="drivingelapse" class="rptBodyCol">0:00:01</BodyColumn>
<BodyColumn id="odomdelta" class="rptBodyCol">0.0</BodyColumn>
<BodyColumn id="stopdatetime" class="rptBodyCol">2014/03/06 09:41:39</BodyColumn>
<BodyColumn id="stopgeopoint" class="rptBodyCol">21.0906/79.0650</BodyColumn>
<BodyColumn id="stopaddress" class="rptBodyCol">Home Zone</BodyColumn>
<BodyColumn id="idleelapse" class="rptBodyCol">0:00:18</BodyColumn>
<BodyColumn id="stopelapse" class="rptBodyCol">0:00:18</BodyColumn>
</BodyRow>
<BodyRow class="rptBodyRowEven">
<BodyColumn id="index" class="rptBodyCol">2</BodyColumn>
<BodyColumn id="startdatetime" class="rptBodyCol">2014/03/06 09:41:57</BodyColumn>
<BodyColumn id="drivingelapse" class="rptBodyCol">0:01:26</BodyColumn>
<BodyColumn id="odomdelta" class="rptBodyCol">0.3</BodyColumn>
<BodyColumn id="stopdatetime" class="rptBodyCol">2014/03/06 09:43:23</BodyColumn>
<BodyColumn id="stopgeopoint" class="rptBodyCol">21.0936/79.0655</BodyColumn>
<BodyColumn id="stopaddress" class="rptBodyCol" />
<BodyColumn id="idleelapse" class="rptBodyCol">0:02:07</BodyColumn>
<BodyColumn id="stopelapse" class="rptBodyCol">0:02:07</BodyColumn>
</BodyRow>
<BodyRow class="rptBodyRowOdd">
<BodyColumn id="index" class="rptBodyCol">3</BodyColumn>
<BodyColumn id="startdatetime" class="rptBodyCol">2014/03/06 09:45:30</BodyColumn>
<BodyColumn id="drivingelapse" class="rptBodyCol">0:02:33</BodyColumn>
<BodyColumn id="odomdelta" class="rptBodyCol">0.7</BodyColumn>
<BodyColumn id="stopdatetime" class="rptBodyCol">2014/03/06 09:48:03</BodyColumn>
<BodyColumn id="stopgeopoint" class="rptBodyCol">21.1025/79.0675</BodyColumn>
<BodyColumn id="stopaddress" class="rptBodyCol" />
<BodyColumn id="idleelapse" class="rptBodyCol">0:01:47</BodyColumn>
<BodyColumn id="stopelapse" class="rptBodyCol">0:01:47</BodyColumn>
</BodyRow>
<BodyRow class="rptBodyRowEven">
<BodyColumn id="index" class="rptBodyCol">4</BodyColumn>
<BodyColumn id="startdatetime" class="rptBodyCol">2014/03/06 09:49:50</BodyColumn>
<BodyColumn id="drivingelapse" class="rptBodyCol">0:02:46</BodyColumn>
<BodyColumn id="odomdelta" class="rptBodyCol">0.6</BodyColumn>
<BodyColumn id="stopdatetime" class="rptBodyCol">2014/03/06 09:52:36</BodyColumn>
<BodyColumn id="stopgeopoint" class="rptBodyCol">21.0888/79.0651</BodyColumn>
<BodyColumn id="stopaddress" class="rptBodyCol">Home Zone</BodyColumn>
<BodyColumn id="idleelapse" class="rptBodyCol">0:31:39</BodyColumn>
<BodyColumn id="stopelapse" class="rptBodyCol">0:31:39</BodyColumn>
</BodyRow>
<BodyRow class="rptBodyRowOdd">
<BodyColumn id="index" class="rptBodyCol">5</BodyColumn>
<BodyColumn id="startdatetime" class="rptBodyCol">2014/03/06 10:24:15</BodyColumn>
<BodyColumn id="drivingelapse" class="rptBodyCol">0:03:23</BodyColumn>
<BodyColumn id="odomdelta" class="rptBodyCol" />
<BodyColumn id="stopdatetime" class="rptBodyCol">2014/03/06 10:27:38</BodyColumn>
<BodyColumn id="stopgeopoint" class="rptBodyCol">21.1016/79.0676</BodyColumn>
<BodyColumn id="stopaddress" class="rptBodyCol" />
<BodyColumn id="idleelapse" class="rptBodyCol">0:00:19</BodyColumn>
<BodyColumn id="stopelapse" class="rptBodyCol">0:00:19</BodyColumn>
</BodyRow>
<BodyRow class="rptBodyRowEven">
<BodyColumn id="index" class="rptBodyCol">6</BodyColumn>
<BodyColumn id="startdatetime" class="rptBodyCol">2014/03/06 10:27:57</BodyColumn>
<BodyColumn id="drivingelapse" class="rptBodyCol">0:02:46</BodyColumn>
<BodyColumn id="odomdelta" class="rptBodyCol">1.4</BodyColumn>
<BodyColumn id="stopdatetime" class="rptBodyCol">2014/03/06 10:30:43</BodyColumn>
<BodyColumn id="stopgeopoint" class="rptBodyCol">21.1078/79.0792</BodyColumn>
<BodyColumn id="stopaddress" class="rptBodyCol">KIPL Zone</BodyColumn>
<BodyColumn id="idleelapse" class="rptBodyCol">0:00:10</BodyColumn>
<BodyColumn id="stopelapse" class="rptBodyCol">0:00:10</BodyColumn>
</BodyRow>
<BodyRow class="rptBodyRowOdd">
<BodyColumn id="index" class="rptBodyCol">7</BodyColumn>
<BodyColumn id="startdatetime" class="rptBodyCol">2014/03/06 10:30:53</BodyColumn>
<BodyColumn id="drivingelapse" class="rptBodyCol">0:01:20</BodyColumn>
<BodyColumn id="odomdelta" class="rptBodyCol">0.3</BodyColumn>
<BodyColumn id="stopdatetime" class="rptBodyCol">2014/03/06 10:32:13</BodyColumn>
<BodyColumn id="stopgeopoint" class="rptBodyCol">21.1071/79.0824</BodyColumn>
<BodyColumn id="stopaddress" class="rptBodyCol">KIPL Zone</BodyColumn>
<BodyColumn id="idleelapse" class="rptBodyCol">2:45:23</BodyColumn>
<BodyColumn id="stopelapse" class="rptBodyCol">2:45:23</BodyColumn>
</BodyRow>
<BodyRow class="rptBodyRowEven">
<BodyColumn id="index" class="rptBodyCol">8</BodyColumn>
<BodyColumn id="startdatetime" class="rptBodyCol">2014/03/06 13:17:36</BodyColumn>
<BodyColumn id="drivingelapse" class="rptBodyCol">0:03:48</BodyColumn>
<BodyColumn id="odomdelta" class="rptBodyCol" />
<BodyColumn id="stopdatetime" class="rptBodyCol">2014/03/06 13:21:24</BodyColumn>
<BodyColumn id="stopgeopoint" class="rptBodyCol">21.0984/79.0669</BodyColumn>
<BodyColumn id="stopaddress" class="rptBodyCol" />
<BodyColumn id="idleelapse" class="rptBodyCol">0:00:30</BodyColumn>
<BodyColumn id="stopelapse" class="rptBodyCol">0:00:30</BodyColumn>
</BodyRow>
<BodyRow class="rptBodyRowOdd">
<BodyColumn id="index" class="rptBodyCol">9</BodyColumn>
<BodyColumn id="startdatetime" class="rptBodyCol">2014/03/06 13:21:54</BodyColumn>
<BodyColumn id="drivingelapse" class="rptBodyCol">0:01:59</BodyColumn>
<BodyColumn id="odomdelta" class="rptBodyCol">1.1</BodyColumn>
<BodyColumn id="stopdatetime" class="rptBodyCol">2014/03/06 13:23:53</BodyColumn>
<BodyColumn id="stopgeopoint" class="rptBodyCol">21.0888/79.0651</BodyColumn>
<BodyColumn id="stopaddress" class="rptBodyCol">Home Zone</BodyColumn>
<BodyColumn id="idleelapse" class="rptBodyCol">1:30:41</BodyColumn>
<BodyColumn id="stopelapse" class="rptBodyCol">1:30:41</BodyColumn>
</BodyRow>
<BodyRow class="rptBodyRowEven">
<BodyColumn id="index" class="rptBodyCol">10</BodyColumn>
<BodyColumn id="startdatetime" class="rptBodyCol">2014/03/06 14:54:34</BodyColumn>
<BodyColumn id="drivingelapse" class="rptBodyCol">0:00:44</BodyColumn>
<BodyColumn id="odomdelta" class="rptBodyCol" />
<BodyColumn id="stopdatetime" class="rptBodyCol">2014/03/06 14:55:18</BodyColumn>
<BodyColumn id="stopgeopoint" class="rptBodyCol">21.0905/79.0650</BodyColumn>
<BodyColumn id="stopaddress" class="rptBodyCol">Home Zone</BodyColumn>
<BodyColumn id="idleelapse" class="rptBodyCol">0:00:07</BodyColumn>
<BodyColumn id="stopelapse" class="rptBodyCol">0:00:07</BodyColumn>
</BodyRow>
<BodyRow class="rptBodyRowOdd">
<BodyColumn id="index" class="rptBodyCol">11</BodyColumn>
<BodyColumn id="startdatetime" class="rptBodyCol">2014/03/06 14:55:25</BodyColumn>
<BodyColumn id="drivingelapse" class="rptBodyCol">0:01:37</BodyColumn>
<BodyColumn id="odomdelta" class="rptBodyCol">0.7</BodyColumn>
<BodyColumn id="stopdatetime" class="rptBodyCol">2014/03/06 14:57:02</BodyColumn>
<BodyColumn id="stopgeopoint" class="rptBodyCol">21.0967/79.0665</BodyColumn>
<BodyColumn id="stopaddress" class="rptBodyCol" />
<BodyColumn id="idleelapse" class="rptBodyCol">0:00:25</BodyColumn>
<BodyColumn id="stopelapse" class="rptBodyCol">0:00:25</BodyColumn>
</BodyRow>
<BodyRow class="rptBodyRowEven">
<BodyColumn id="index" class="rptBodyCol">12</BodyColumn>
<BodyColumn id="startdatetime" class="rptBodyCol">2014/03/06 14:57:27</BodyColumn>
<BodyColumn id="drivingelapse" class="rptBodyCol">0:00:50</BodyColumn>
<BodyColumn id="odomdelta" class="rptBodyCol">0.1</BodyColumn>
<BodyColumn id="stopdatetime" class="rptBodyCol">2014/03/06 14:58:17</BodyColumn>
<BodyColumn id="stopgeopoint" class="rptBodyCol">21.0979/79.0668</BodyColumn>
<BodyColumn id="stopaddress" class="rptBodyCol" />
<BodyColumn id="idleelapse" class="rptBodyCol">0:01:01</BodyColumn>
<BodyColumn id="stopelapse" class="rptBodyCol">0:01:01</BodyColumn>
</BodyRow>
<BodyRow class="rptBodyRowOdd">
<BodyColumn id="index" class="rptBodyCol">13</BodyColumn>
<BodyColumn id="startdatetime" class="rptBodyCol">2014/03/06 14:59:18</BodyColumn>
<BodyColumn id="drivingelapse" class="rptBodyCol">0:01:50</BodyColumn>
<BodyColumn id="odomdelta" class="rptBodyCol">0.7</BodyColumn>
<BodyColumn id="stopdatetime" class="rptBodyCol">2014/03/06 15:01:08</BodyColumn>
<BodyColumn id="stopgeopoint" class="rptBodyCol">21.1037/79.0682</BodyColumn>
<BodyColumn id="stopaddress" class="rptBodyCol" />
<BodyColumn id="idleelapse" class="rptBodyCol">0:00:46</BodyColumn>
<BodyColumn id="stopelapse" class="rptBodyCol">0:00:46</BodyColumn>
</BodyRow>
<BodyRow class="rptBodyRowEven">
<BodyColumn id="index" class="rptBodyCol">14</BodyColumn>
<BodyColumn id="startdatetime" class="rptBodyCol">2014/03/06 15:01:54</BodyColumn>
<BodyColumn id="drivingelapse" class="rptBodyCol">0:02:03</BodyColumn>
<BodyColumn id="odomdelta" class="rptBodyCol">1.2</BodyColumn>
<BodyColumn id="stopdatetime" class="rptBodyCol">2014/03/06 15:03:57</BodyColumn>
<BodyColumn id="stopgeopoint" class="rptBodyCol">21.1078/79.0794</BodyColumn>
<BodyColumn id="stopaddress" class="rptBodyCol">KIPL Zone</BodyColumn>
<BodyColumn id="idleelapse" class="rptBodyCol">0:00:10</BodyColumn>
<BodyColumn id="stopelapse" class="rptBodyCol">0:00:10</BodyColumn>
</BodyRow>
<BodyRow class="rptBodyRowOdd">
<BodyColumn id="index" class="rptBodyCol">15</BodyColumn>
<BodyColumn id="startdatetime" class="rptBodyCol">2014/03/06 15:04:07</BodyColumn>
<BodyColumn id="drivingelapse" class="rptBodyCol">0:01:23</BodyColumn>
<BodyColumn id="odomdelta" class="rptBodyCol">0.4</BodyColumn>
<BodyColumn id="stopdatetime" class="rptBodyCol">2014/03/06 15:05:30</BodyColumn>
<BodyColumn id="stopgeopoint" class="rptBodyCol">21.1070/79.0825</BodyColumn>
<BodyColumn id="stopaddress" class="rptBodyCol">KIPL Zone</BodyColumn>
<BodyColumn id="idleelapse" class="rptBodyCol">4:43:07</BodyColumn>
<BodyColumn id="stopelapse" class="rptBodyCol">4:43:07</BodyColumn>
</BodyRow>
<BodyRow class="rptBodyRowEven">
<BodyColumn id="index" class="rptBodyCol">16</BodyColumn>
<BodyColumn id="startdatetime" class="rptBodyCol">2014/03/06 19:48:37</BodyColumn>
<BodyColumn id="drivingelapse" class="rptBodyCol">0:03:37</BodyColumn>
<BodyColumn id="odomdelta" class="rptBodyCol" />
<BodyColumn id="stopdatetime" class="rptBodyCol">2014/03/06 19:52:14</BodyColumn>
<BodyColumn id="stopgeopoint" class="rptBodyCol">21.0985/79.0669</BodyColumn>
<BodyColumn id="stopaddress" class="rptBodyCol" />
<BodyColumn id="idleelapse" class="rptBodyCol">0:00:05</BodyColumn>
<BodyColumn id="stopelapse" class="rptBodyCol">0:00:05</BodyColumn>
</BodyRow>
<BodyRow class="rptBodyRowOdd">
<BodyColumn id="index" class="rptBodyCol">17</BodyColumn>
<BodyColumn id="startdatetime" class="rptBodyCol">2014/03/06 19:52:19</BodyColumn>
<BodyColumn id="drivingelapse" class="rptBodyCol">0:00:54</BodyColumn>
<BodyColumn id="odomdelta" class="rptBodyCol">0.4</BodyColumn>
<BodyColumn id="stopdatetime" class="rptBodyCol">2014/03/06 19:53:13</BodyColumn>
<BodyColumn id="stopgeopoint" class="rptBodyCol">21.0948/79.0661</BodyColumn>
<BodyColumn id="stopaddress" class="rptBodyCol" />
<BodyColumn id="idleelapse" class="rptBodyCol">0:03:19</BodyColumn>
<BodyColumn id="stopelapse" class="rptBodyCol">0:03:19</BodyColumn>
</BodyRow>
<BodyRow class="rptBodyRowEven">
<BodyColumn id="index" class="rptBodyCol">18</BodyColumn>
<BodyColumn id="startdatetime" class="rptBodyCol">2014/03/06 19:56:32</BodyColumn>
<BodyColumn id="drivingelapse" class="rptBodyCol">0:01:20</BodyColumn>
<BodyColumn id="odomdelta" class="rptBodyCol" />
<BodyColumn id="stopdatetime" class="rptBodyCol">2014/03/06 19:57:52</BodyColumn>
<BodyColumn id="stopgeopoint" class="rptBodyCol">21.0887/79.0651</BodyColumn>
<BodyColumn id="stopaddress" class="rptBodyCol">Home Zone</BodyColumn>
<BodyColumn id="idleelapse" class="rptBodyCol" />
<BodyColumn id="stopelapse" class="rptBodyCol" />
</BodyRow>
<BodyRow class="rptTotalRow">
<BodyColumn id="index" class="rptTotalCol">1</BodyColumn>
<BodyColumn id="startdatetime" class="rptTotalCol" />
<BodyColumn id="drivingelapse" class="rptTotalCol">0:34:20</BodyColumn>
<BodyColumn id="odomdelta" class="rptTotalCol">8.1</BodyColumn>
<BodyColumn id="stopdatetime" class="rptTotalCol" />
<BodyColumn id="stopgeopoint" class="rptTotalCol" />
<BodyColumn id="stopaddress" class="rptTotalCol" />
<BodyColumn id="idleelapse" class="rptTotalCol">9:41:54</BodyColumn>
<BodyColumn id="stopelapse" class="rptTotalCol">9:41:54</BodyColumn>
</BodyRow>
</ReportBody>
<Partial>false</Partial>
</Report>
我需要解析这个xml,所以你能告诉我你是怎么做到的吗?
3条答案
按热度按时间a9wyjsp71#
请使用此代码
3lxsmp7m2#
用于sax或dom解析器。
例如(回答您的意见):
djmepvbi3#
使用此演示示例解析xml:link