找回密码
 立即注册
android开发 2022-10-29 47 0star收藏 版权: . 保留作者信息 . 禁止商业使用 . 禁止修改作品
XML解析器:DOM和SAX现在大家触摸的解析XML文件的比如都使用SAX。理解SAX的朋友一定知识,还有一种叫DOM(DocumentObjectModel,文档对象模型)的解析方案也是很常见的。现在大家触摸的解析XML文件的比如都使用SAX。理解SAX的朋友一定知识,还有一种叫DOM(DocumentObjectModel,文档对象模型)的解析方案也是很常见的。简单地说,DOM选用树形框架的方法访问XML文档,而SAX选用事情模型的方法访问XML文档。自己前面现已发布过一个使用SAX解析XML的比如(一个小气候预报使用,用SAX解析Google的气候API),下面是这个程序的一些截图:注意:这个使用是通过美国国家地震局页面(earthquake.usgs.gov/earthquakes/catalogs/1day-M2.5.xml)获取当前全球实时的地震状况,然后再用DOM解析XML中的内容。本资料共包括以下附件:
EarthquakeList\bin\com\studio\android\EarthQuakeInfo.class
EarthquakeList\bin\com\studio\android\EarthquakeList.class
EarthquakeList\bin\com\studio\android\R$attr.class
EarthquakeList\bin\com\studio\android\R$drawable.class
EarthquakeList\bin\com\studio\android\R$id.class
EarthquakeList\bin\com\studio\android\R$layout.class
EarthquakeList\bin\com\studio\android\R$string.class
EarthquakeList\bin\com\studio\android\R.class
EarthquakeList\bin\classes.dex
EarthquakeList\bin\EarthquakeList.apk
EarthquakeList\bin\resources.ap_
EarthquakeList\gen\com\studio\android\R.java
EarthquakeList\res\drawable\icon.png
EarthquakeList\res\layout\main.xml
EarthquakeList\res\values\strings.xml
EarthquakeList\src\com\studio\android\EarthQuakeInfo.java
EarthquakeList\src\com\studio\android\EarthquakeList.java
EarthquakeList\.classpath
EarthquakeList\.project
EarthquakeList\AndroidManifest.xml
EarthquakeList\default.properties
.....

(XML parser: DOM and SAX are used for parsing XML files. A friend who understands SAX has some knowledge. There is also a parsing scheme called DOM (Document Object Model) which is very common. Now we use SAX to parse XML files. A friend who understands SAX has some knowledge. There is also a parsing scheme called DOM (Document Object Model) which is very common. To put it simply, DOM uses the tree frame method to access XML documents, while SAX uses the event model method to access XML documents. I have previously published a program that uses SAX to parse XML, such as (a microclimate prediction application, using SAX to parse Google's climate API). Here are some screenshots of the program: Note: This application uses the National Seismological Bureau page (earthquake. usgs. gov/earthquakes/catalogs/1day-M2.5. xml) to obtain the current global real-time earthquake conditions, and then uses DOM to parse the XML content. This document includes the following annexes:
EarthquakeList\bin\com\studio\android\EarthQuakeInfo.class
EarthquakeList\bin\com\studio\android\EarthquakeList.class
EarthquakeList\bin\com\studio\android\R$attr.class
EarthquakeList\bin\com\studio\android\R$drawable.class
EarthquakeList\bin\com\studio\android\R$id.class
EarthquakeList\bin\com\studio\android\R$layout.class
EarthquakeList\bin\com\studio\android\R$string.class
EarthquakeList\bin\com\studio\android\R.class
EarthquakeList\bin\classes.dex
EarthquakeList\bin\EarthquakeList.apk
EarthquakeList\bin\resources.ap_
EarthquakeList\gen\com\studio\android\R.java
EarthquakeList\res\drawable\icon.png
EarthquakeList\res\layout\main.xml
EarthquakeList\res\values\strings.xml
EarthquakeList\src\com\studio\android\EarthQuakeInfo.java
EarthquakeList\src\com\studio\android\EarthquakeList.java
EarthquakeList\.classpath
EarthquakeList\.project
EarthquakeList\AndroidManifest.xml
EarthquakeList\default.properties
.....)

[下载]15504069037.rar




上一篇:Android 中G象棋源码
下一篇:Android 给应用定制皮肤