【发布时间】:2011-04-20 12:43:46
【问题描述】:
您好,我有一个 android 应用程序,我想从 xml 文件中获取数据。 我使用了 SAX 解析器,但是从这里给出的这种类型的 xml 文件中获取数据存在一些问题,所以请给我解决方案 使用 SAX 解析解析以下 xml 文件
我的 xml 文件在这里
<?xml version="1.0" encoding="utf-8"?>
<xml>
<movie>
<file>
<type>1</type>
<url>http://www.mauitheatre.com/</url>
<path>http://64.250.238.26:1111/clips/UlalenaSplashAdd.jpg</path>
<title>UlalenaSplash</title>
</file>
<file>
<type>0</type>
<path>http://64.250.238.26:1111/clips/BaldwinBeach.mp4</path>
<title>Baldwin Beach</title>
</file>
</movie>
<movie>
<file>
<type>0</type>
<url></url>
<path>http://64.250.238.26:1111/clips/AppTeaser.mp4</path>
<title>SlackKeyShow</title>
</file>
<file>
<type>0</type>
<path>http://64.250.238.26:1111/clips/BigBeach.mp4</path>
<title>Big Beach</title>
</file>
</movie>
<movie>
<file>
<type>1</type>
<url>http://www.mountainapplecompany.com/new-releases/keola-beamer-and-raiatea</url>
<path>http://64.250.238.26:1111/clips/raiateaADD.jpg</path>
<title>Raiatea Keola Beamer add</title>
</file>
<file>
<type>0</type>
<path>http://64.250.238.26:1111/clips/CharleyYoungBeach.mp4</path>
<title>Charley Young Beach</title>
</file>
</movie>
<movie>
<file>
<type>1</type>
<url>http://www.bennyuyetake.com</url>
<path>http://64.250.238.26:1111/clips/BennyUyetake.jpg</path>
<title>Benny Uyetake SPlash</title>
</file>
<file>
<type>0</type>
<path>http://64.250.238.26:1111/clips/HamoaBeach-1.mp4</path>
<title>Hamoa Beach</title>
</file>
</movie>
<movie>
<file>
<type>1</type>
<url>http://www.dericksebastian.com</url>
<path>http://64.250.238.26:1111/clips/DSSplash.jpg</path>
<title>DS Splash</title>
</file>
<file>
<type>0</type>
<path>http://64.250.238.26:1111/clips/HanaBay.mp4</path>
<title>Hana Bay</title>
</file>
</movie>
<movie>
<file>
<type>1</type>
<url>http://www.mountainapplecompany.com/new-releases/keola-beamer-and-raiatea</url>
<path>http://64.250.238.26:1111/clips/raiateaADD.jpg</path>
<title>Raiatea Keola Beamer add</title>
</file>
<file>
<type>0</type>
<path>http://64.250.238.26:1111/clips/KamaoleBeachPark1b-1.mp4</path>
<title>Kamaole Beach Park 1</title>
</file>
</movie>
</xml>
【问题讨论】:
-
能否请您粘贴错误?否则很难查明问题。
-
也分享你的解析器实现,让我们看看那里可能出了什么问题。谢谢!