Java 我没有XML方面的经验。我如何理解这个XML文件中写了什么?
我必须开始创建一个android应用程序。但是,我没有XML方面的经验,也不了解这种语言。这个XML文件存储了我必须用来创建Java程序的数据。我不明白我在看什么,也不知道如何阅读这种语言。我想解释数据,这样我就可以开始用Java编码了。请帮忙 我曾尝试观看视频和学习XML,但似乎无法应用基础知识来解释此文件中提供给我的信息Java 我没有XML方面的经验。我如何理解这个XML文件中写了什么?,java,android,xml,Java,Android,Xml,我必须开始创建一个android应用程序。但是,我没有XML方面的经验,也不了解这种语言。这个XML文件存储了我必须用来创建Java程序的数据。我不明白我在看什么,也不知道如何阅读这种语言。我想解释数据,这样我就可以开始用Java编码了。请帮忙 我曾尝试观看视频和学习XML,但似乎无法应用基础知识来解释此文件中提供给我的信息 <task name="neddle decompression" steps="8"> <step description="
<task name="neddle decompression" steps="8">
<step
description="Obtain a 14 gauge needle with catheter
from your first aid kit.">
<aid aid="needle.jpg">
</aid>
<aid aid="needle.avi">
</aid>
</step>
<step description="Locate position on chest.">
<aid aid="position.jpg">
</aid>
</step>
<step description="Prepare chest area with antiseptic.">
<aid aid="none">
</aid>
</step>
<step description="Insert the needle at a 90 degree angle.">
<aid aid="insert.jpg">
</aid>
</step>
<step
description="Stop advancing the needle once a hiss of pop of air is heard. You should feel a 'pop' as the needle enters the chest cavity.">
<aid aid="none">
</aid>
</step>
<step description="Hold the catheter in place and remove the needle.">
<aid aid="catheter.jpg">
</aid>
</step>
<step description="Leave the catheter and safely dispose of the needle.">
<aid aid="dispose.jpg">
</aid>
</step>
<step
description="Tape the catheter in place and monitor the casualty until the medivac is available to insert a chest tube.">
<aid image="tape.jpg">
</aid>
</step>
</task>
<task name="task2" steps="2">
<step description="step1">
<aid image="image1.png">
</aid>
</step>
<step destription="step2">
<aid aid="image.png">
</aid>
<aid aid="image3.avi">
</aid>
</step>
</task>
我希望从这个文件中获得Java程序中需要的类和属性的指南。XML只是数据的一种格式,内容在open
tag
(例如:
)和endtag
(例如:
)中。当父标记有子标记时,只需将这些子标记放在父打开标记和结束标记之间,依此类推。一般来说,XML是一种嵌套结构
<task name="neddle decompression" steps="8">
<step
description="Obtain a 14 gauge needle with catheter
from your first aid kit.">
<aid aid="needle.jpg">
</aid>
<aid aid="needle.avi">
</aid>
</step>
<step description="Locate position on chest.">
<aid aid="position.jpg">
</aid>
</step>
<step description="Prepare chest area with antiseptic.">
<aid aid="none">
</aid>
</step>
<step description="Insert the needle at a 90 degree angle.">
<aid aid="insert.jpg">
</aid>
</step>
<step
description="Stop advancing the needle once a hiss of pop of air is heard. You should feel a 'pop' as the needle enters the chest cavity.">
<aid aid="none">
</aid>
</step>
<step description="Hold the catheter in place and remove the needle.">
<aid aid="catheter.jpg">
</aid>
</step>
<step description="Leave the catheter and safely dispose of the needle.">
<aid aid="dispose.jpg">
</aid>
</step>
<step
description="Tape the catheter in place and monitor the casualty until the medivac is available to insert a chest tube.">
<aid image="tape.jpg">
</aid>
</step>
</task>
<task name="task2" steps="2">
<step description="step1">
<aid image="image1.png">
</aid>
</step>
<step destription="step2">
<aid aid="image.png">
</aid>
<aid aid="image3.avi">
</aid>
</step>
</task>
简单示例:族(父标记)有两个成员:成员1(级别1子标记)、成员2(级别1子标记)。成员1命名Alice(第2级子标记)和24岁(第2级子标记),成员2命名Bob(第2级子标记)和27岁(第2级子标记),然后您可以使用XML存储此类数据:
<family>
<member>
<name>Alice</name>
<age>24</age>
</member>
<member>
<name>Bob</name>
<age>27</age>
</member>
</family>
爱丽丝
祝你好运 这是一个很棒的教程,在Udacity中是免费的。谷歌也制作了它来帮助新的android开发者:你知道如何处理Json吗?你必须学会如何用java解析XML。我不认为您提供的XML是针对Android问题的。如果您说您无法学习如何使用XML,我们该怎么办?我建议你在网上找一个更好的老师,或者在网上找一个更好的老师。XML并不是编程中最难的事情。