//简单xml解析

import string.xml

//example
xmlstr =  /* <?xml version="1.0" encoding="gb2312"?>
<project ver="0.60" name="快手工程3" libEmbed="true" icon="...">
  <file name="main.aau" path="main.aau" > 
  </file>
  <folder name="资源文件" path="res" embed="true">
  	<![CDATA[ 
  		<folder name="资源文件" path="res" embed="true">
  	]]>
  </folder>
  <folder name="库" path="lib">
  </folder>
</project>

*/

io.open()
tab = string.xml( xmlstr )

for(i,folder in tab.project[1].folder   ){
   io.print( folder.name, folder.path,folder.cdata )
}

io.print("
---------------分析百度RSS----------------
")

import inet.http
str = inet.http().get("http://news.baidu.com/n?cmd=1&class=civilnews&tn=rss")

xml = string.xml(str)
for(i,item in xml.rss[1].channel[1].item ){
	io.print( item.title[1].cdata )
}
