日期:2014-05-17  浏览次数:20718 次

求高手写 SAX解析xml文件
用java编写代码解析下面的xml 我看了很多关于SAX解析的步骤,还是不太懂,希望有类似的代码能让我理解一下


<? xml version = "1.0" encoding = "UTF-8" ?> 
<fps version = "1.2" > 
<item> 
<title> A+B </title> 
<time_limit unit = "s" > 1 </time_limit>
<memory_limit unit = "mb" > 64 </memory_limit> 
<img> 
<src> JudgeOnline/upload/201009/Screenshot.png </src> 
<base64> iVBORw0K[BASE64_ENCODED_IMAGE_BINARY]RU5ErkJggg== </base64> 
</img> 
<description> <![CDATA[print the sum of two integer <img src = JudgeOnline/upload/201009/Screenshot.png > ]]> </description> 
<input> two integer a and b </input> 
<output> the sum of a and b </output> 
<sample_input> 1 2 </sample_input> 
<sample_output> 3 </sample_output> 
<test_input> <![CDATA[2 3]]> </test_input> 
<test_output> <![CDATA[5]]> </test_output> 
<hint> use scanf and printf in stdio.h </hint> 
<source> http://www.test.com/test </source> 
<solution Xlanguage= "C++" > <![CDATA[ 
#include <iostream> 
using namespace std; 
int main() 

int a,b; 
cin >> a >> b; 
cout << a+b << endl; 
return 0; 

]]> </solution> 
<spj Xlanguage= "C" ></spj> 
</item> 
</fps>

------解决方案--------------------
电驴上讲解Android的视频 基本上都有sax解析和dom解析
下个视频再baidu google!
------解决方案--------------------
你这是java 吗?
------解决方案--------------------
教程应该都有这方面的内容吧
------解决方案--------------------
曾经有个人跟我说这个不用,于是我就没学,结果……
------解决方案--------------------
挺简单的自己看看文档啊。