【问题标题】:I need an xml parser in android for the following codes我需要一个 android 中的 xml 解析器来获取以下代码
【发布时间】:2023-03-17 15:54:01
【问题描述】:
<TRACKS>
<songs>
-       <song>
             <name>7340027045879.xml</_name> 
             <Downloadable>True</Downloadable> 
             <Streaming>True</Streaming> 
-        <Setting>
                <Price>9.99</Price> 
                <Purcahse_``Id>213213123sadsadsaasdsss</Purcahse_Id> 
-        </Setting>
         </song>
</songs>
<songs>
-        <song>
                <name>7340027045879.xml</_name> 
                <Downloadable>True</Downloadable> 
                <Streaming>True</Streaming> 
-        <Setting>
                <Price>9.99</Price> 
                <Purcahse_Id>213213123sadsadsaasdsss</Purcahse_Id> 
-        </Setting>
         </song>
-<songs>
</tracks>
<social include="True">
               <tag>True</tag> 
               <account>False</feed> 
-       <details>
              <tag>Carola</tag> 
        </details>
</social>

我是 android 新手,所以任何人都可以帮助我使用 android 中的 xml 解析器解析这个特定的 xml,并且应该在文件夹本身中访问 xml 的源代码。谢谢。:)

【问题讨论】:

  • 您尝试过什么,效果如何,如何失败? SO 不是“向我发送 codez”的位置
  • StackOverflow 是用来提出具体的编码问题,而不是要求人们为你写代码。

标签: android xml xml-parsing android-xml


【解决方案1】:

您可以使用SAXParser。你可以找到一个很棒的教程here。读出来:D

【讨论】:

    【解决方案2】:

    您可以在 IBM 的 developerWorks 网站上查看 Working with XML on Android。它很好地概述了可用的 XML 解析选项以及每个选项的一些示例代码。

    【讨论】:

      猜你喜欢
      • 2013-12-09
      • 2022-01-18
      • 1970-01-01
      • 2017-04-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-24
      相关资源
      最近更新 更多