Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/string/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
blackberry中解析xml的问题_Xml_Parsing_Blackberry - Fatal编程技术网

blackberry中解析xml的问题

blackberry中解析xml的问题,xml,parsing,blackberry,Xml,Parsing,Blackberry,我正在使用SAX解析器解析来自http url的XML数据。 我正在创建一个BlackBerry应用程序,它显示从一个位置到另一个位置的方向数据 我的应用程序非常准确地解析了某些位置的数据,但对于某些位置,它向我提供了org.xml.sax.saxpasseeption:End标记与start标记“meta”不匹配 当我跟踪我的应用程序时,我知道来自http url的数据是不正确的,尽管url包含正确的xml数据 我正在分析的XML数据: <?xml version="1.0" encod

我正在使用SAX解析器解析来自http url的XML数据。 我正在创建一个BlackBerry应用程序,它显示从一个位置到另一个位置的方向数据

我的应用程序非常准确地解析了某些位置的数据,但对于某些位置,它向我提供了org.xml.sax.saxpasseeption:End标记与start标记“meta”不匹配

当我跟踪我的应用程序时,我知道来自http url的数据是不正确的,尽管url包含正确的xml数据

我正在分析的XML数据:

<?xml version="1.0" encoding="UTF-8"?> 
<DirectionsResponse> 
 <status>OK</status> 
 <route> 
  <summary>I-65 N and AL-14 W</summary> 
  <leg> 
   <step> 
    <travel_mode>DRIVING</travel_mode> 
    <start_location> 
     <lat>32.4582500</lat> 
     <lng>-86.3841000</lng> 
    </start_location> 
    <end_location> 
     <lat>32.4582300</lat> 
     <lng>-86.3832400</lng> 
    </end_location> 
    <polyline> 
     <points>aobeEr{fnOJyCGQ</points> 
     <levels>B?B</levels> 
    </polyline> 
    <duration> 
     <value>8</value> 
     <text>1 min</text> 
    </duration> 
    <html_instructions>Head &lt;b&gt;east&lt;/b&gt; on &lt;b&gt;Market St&lt;/b&gt;</html_instructions> 
    <distance> 
     <value>81</value> 
     <text>266 ft</text> 
    </distance> 
   </step> 
   <step> 
    <travel_mode>DRIVING</travel_mode> 
    <start_location> 
     <lat>32.4582300</lat> 
     <lng>-86.3832400</lng> 
    </start_location> 
    <end_location> 
     <lat>32.4602500</lat> 
     <lng>-86.3831700</lng> 
    </end_location> 
    <polyline> 
     <points>}nbeEfvfnOsKM</points> 
     <levels>BB</levels> 
    </polyline> 
    <duration> 
     <value>25</value> 
     <text>1 min</text> 
    </duration> 
    <html_instructions>Turn &lt;b&gt;left&lt;/b&gt; to stay on &lt;b&gt;Market St&lt;/b&gt;</html_instructions> 
    <distance> 
     <value>226</value> 
     <text>0.1 mi</text> 
    </distance> 
   </step> 
   <step> 
    <travel_mode>DRIVING</travel_mode> 
    <start_location> 
     <lat>32.4602500</lat> 
     <lng>-86.3831700</lng> 
    </start_location> 
    <end_location> 
     <lat>32.4603600</lat> 
     <lng>-86.3870500</lng> 
    </end_location> 
    <polyline> 
     <points>q{beExufnOUfW</points> 
     <levels>BB</levels> 
    </polyline> 
    <duration> 
     <value>61</value> 
     <text>1 min</text> 
    </duration> 
    <html_instructions>Turn &lt;b&gt;left&lt;/b&gt; onto &lt;b&gt;Cobbs Ford Rd/Co Rd 2&lt;/b&gt;</html_instructions> 
    <distance> 
     <value>364</value> 
     <text>0.2 mi</text> 
    </distance> 
   </step> 
   <step> 
    <travel_mode>DRIVING</travel_mode> 
    <start_location> 
     <lat>32.4603600</lat> 
     <lng>-86.3870500</lng> 
    </start_location> 
    <end_location> 
     <lat>32.4865600</lat> 
     <lng>-86.4070600</lng> 
    </end_location> 
    <polyline> 
     <points>g|beE`ngnOwBfDeExEcCjA{s@z`@mVlOoRdN{t@bl@</points> 
     <levels>B?@??@?B</levels> 
    </polyline> 
    <duration> 
     <value>130</value> 
     <text>2 mins</text> 
    </duration> 
    <html_instructions>Slight &lt;b&gt;right&lt;/b&gt; to merge onto &lt;b&gt;I-65 N&lt;/b&gt; toward &lt;b&gt;Birmingham&lt;/b&gt;</html_instructions> 
    <distance> 
     <value>3478</value> 
     <text>2.2 mi</text> 
    </distance> 
   </step> 
   <step> 
    <travel_mode>DRIVING</travel_mode> 
    <start_location> 
     <lat>32.4865600</lat> 
     <lng>-86.4070600</lng> 
    </start_location> 
    <end_location> 
     <lat>32.4893200</lat> 
     <lng>-86.4084500</lng> 
    </end_location> 
    <polyline> 
     <points>_`heEbkknOeDbBwGvBiBx@</points> 
     <levels>B??B</levels> 
    </polyline> 
    <duration> 
     <value>27</value> 
     <text>1 min</text> 
    </duration> 
    <html_instructions>Take exit &lt;b&gt;181&lt;/b&gt; for &lt;b&gt;AL-14&lt;/b&gt; toward &lt;b&gt;Prattville/Wetumpka&lt;/b&gt;</html_instructions> 
    <distance> 
     <value>333</value> 
     <text>0.2 mi</text> 
    </distance> 
   </step> 
   <step> 
    <travel_mode>DRIVING</travel_mode> 
    <start_location> 
     <lat>32.4893200</lat> 
     <lng>-86.4084500</lng> 
    </start_location> 
    <end_location> 
     <lat>32.4823000</lat> 
     <lng>-86.4286600</lng> 
    </end_location> 
    <polyline> 
     <points>gqheExsknO~PvPpAhAVNJCnDbFjDvGnA`DnAnErA`I^fHtAbz@</points> 
     <levels>B???@???@??B</levels> 
    </polyline> 
    <duration> 
     <value>228</value> 
     <text>4 mins</text> 
    </duration> 
    <html_instructions>Turn &lt;b&gt;left&lt;/b&gt; onto &lt;b&gt;AL-14 W&lt;/b&gt;</html_instructions> 
    <distance> 
     <value>2186</value> 
     <text>1.4 mi</text> 
    </distance> 
   </step> 
   <step> 
    <travel_mode>DRIVING</travel_mode> 
    <start_location> 
     <lat>32.4823000</lat> 
     <lng>-86.4286600</lng> 
    </start_location> 
    <end_location> 
     <lat>32.4755400</lat> 
     <lng>-86.4283300</lng> 
    </end_location> 
    <polyline> 
     <points>kegeEbronO~XJtDU~Di@pCM</points> 
     <levels>B???B</levels> 
    </polyline> 
    <duration> 
     <value>68</value> 
     <text>1 min</text> 
    </duration> 
    <html_instructions>Turn &lt;b&gt;left&lt;/b&gt; onto &lt;b&gt;Jasmine Trail&lt;/b&gt;</html_instructions> 
    <distance> 
     <value>755</value> 
     <text>0.5 mi</text> 
    </distance> 
   </step> 
   <step> 
    <travel_mode>DRIVING</travel_mode> 
    <start_location> 
     <lat>32.4755400</lat> 
     <lng>-86.4283300</lng> 
    </start_location> 
    <end_location> 
     <lat>32.4755400</lat> 
     <lng>-86.4288500</lng> 
    </end_location> 
    <polyline> 
     <points>c{eeE`ponO?fB</points> 
     <levels>BB</levels> 
    </polyline> 
    <duration> 
     <value>11</value> 
     <text>1 min</text> 
    </duration> 
    <html_instructions>Turn &lt;b&gt;right&lt;/b&gt; onto &lt;b&gt;Windermere Ave&lt;/b&gt;&lt;div style=&quot;font-size:0.9em&quot;&gt;Destination will be on the left&lt;/div&gt;</html_instructions> 
    <distance> 
     <value>49</value> 
     <text>161 ft</text> 
    </distance> 
   </step> 
   <duration> 
    <value>558</value> 
    <text>9 mins</text> 
   </duration> 
   <distance> 
    <value>7472</value> 
    <text>4.6 mi</text> 
   </distance> 
   <start_location> 
    <lat>32.4582500</lat> 
    <lng>-86.3841000</lng> 
   </start_location> 
   <end_location> 
    <lat>32.4755400</lat> 
    <lng>-86.4288500</lng> 
   </end_location> 
   <start_address>I65 Srv Rd E, Millbrook, AL 36054, USA</start_address> 
   <end_address>Prattville, AL 36066, USA</end_address> 
  </leg> 
  <copyrights>Map data ©2011 Google</copyrights> 
  <overview_polyline> 
   <points>aobeEr{fnOJyCGSsKKUfWwBfDeExEcCjA{s@z`@uNxIkNjJ{JlH{t@bl@eDbBwGvBiBx@~PvPpAhAVNJCnDbFjDvGnA`DnAnErA`I^fHtAbz@~XJtDU~Di@pCM?fB</points> 
   <levels>B?@@@?@??@??@??A???@???@??@???@B</levels> 
  </overview_polyline> 
  <bounds> 
   <southwest> 
    <lat>32.4581900</lat> 
    <lng>-86.4288500</lng> 
   </southwest> 
   <northeast> 
    <lat>32.4893200</lat> 
    <lng>-86.3831700</lng> 
   </northeast> 
  </bounds> 
 </route> 
</DirectionsResponse> 

好啊
I-65 N和AL-14 W
驱动
32.4582500
-86.3841000 
32.4582300
-86.3832400 
aobeEr{fnOJyCGQ
B?B
8.
1分钟
b市场街/b上的头野兽/b
81
266英尺
驱动
32.4582300
-86.3832400 
32.4602500
-86.3831700 
}nbeEfvfnOsKM
BB
25
1分钟
转动bleft/b以停留在b市场街/b上
226
0.1英里
驱动
32.4602500
-86.3831700 
32.4603600
-86.3870500 
q{Beexufnowfw
BB
61
1分钟
将bleft/b转到b OBBS福特路/Co路2/b
364
0.2英里
驱动
32.4603600
-86.3870500 
32.4865600
-86.4070600 
g | beE'ngnOwBfDeExEcCjA{s@z`@mVlOoRdN{t@bl@ 
B?@???B
130
2分钟
轻微明亮/b合并到bI-65 N/b上,朝向b伯明翰/b
3478
2.2英里
驱动
32.4865600
-86.4070600 
32.4893200
-86.4084500 
_`HeebkKnowedBBWGVBIBX@
B??B
27
1分钟
从b181/b出口前往bAL-14/b,前往bPrattville/Wetumpka/b
333
0.2英里
驱动
32.4893200
-86.4084500 
32.4823000
-86.4286600 
GQheexkno~PvPpAhAVNJCnDbFjDvGnA`DnAnErA`I^fHtAbz@
B???@???B
228
4分钟
将bleft/b转到bAL-14 W/b上
2186
1.4英里
驱动
32.4823000
-86.4286600 
32.4755400
-86.4283300 
kegeEbronO~XJtDU~Di@pCM 
B???B
68
1分钟
将bleft/b转到b车道/b
755
0.5英里
驱动
32.4755400
-86.4283300 
32.4755400
-86.4288500 
c{eeE`ponO?fB
BB
11
1分钟
将bright/b转到b英德米尔大道/bdiv style=“font size:0.9em”目的地将在左侧/div
49
161英尺
558
9分钟
7472
4.6英里
32.4582500
-86.3841000 
32.4755400
-86.4288500 
美国阿尔卑斯州米尔布鲁克Srv东路I65号,邮编:36054
普拉特维尔,阿尔36066,美国
地图数据©2011谷歌
aobeEr{fnojycgsskkufwbfdeexeccja{s@z`@uNxIkNjJ{JlH{t@bl@eDbBwGvBiBx@~PvPpAhAVNJCnDbFjDvGnA`DnAnErA`I^fHtAbz@~XJtDU~Di@pCM?fB
B?@@@@A?@@@B
32.4581900
-86.4288500 
32.4893200
-86.3831700 

您能给我看一下返回此XML数据的URL吗?可能是URL创建的问题。我在应用程序中使用了所有这些信息,发现我的问题不是URL解析器


您可能会遇到同样的问题,所以只需使用“+”而不是空格。请告诉我它是否有效。

通常,此类问题会包括导致问题的实际xml文本。没有它,任何人都很难提供帮助。先生,我添加了xml数据,我正在尝试解析这些数据