خواندن از فایل XML و اضافه به listView در b4a
دوشنبه, ۵ مرداد ۱۳۹۴، ۰۵:۱۱ ب.ظ
خواندن از فایل XML و اضافه به listView در b4a
کد:
Sub Parser_StartElement (Uri As String, Name As String, Attributes As Attributes)
End Sub
Sub Parser_EndElement (Uri As String, Name As String, Text As StringBuilder)
If parser.Parents.IndexOf("item") > -1 Then
If Name = "title" Then
Title = Text.ToString
Else If Name = "link" Then
Link = Text.ToString
End If
End If
If Name = "item" Then
ListView1.AddSingleLine2(Title, Link) 'add the title as the text and the link as the value
End If
End Sub
کد:
Dim in As InputStream
in = File.OpenInput(File.DirAssets, "rss.xml") 'This file was added with the file manager.
parser.Parse(in, "Parser") '"Parser" is the events subs prefix.
in.Close
http://s5.picofile.com/file/8161001300/XmlSax.zip.html
منبع:
http://www.b4x.com/android/forum/threads...rary.6866/
خرید آموزش b4a فارسی با قیمت کم:
http://gameover.blog.ir/1395/04/03/%DA%A9%D8%AA%D8%A7%D8%A8-%D9%81%D8%A7%D8%B1%D8%B3%DB%8C-%D8%A7%D9%85%D9%88%D8%B2%D8%B4-b4a-%D8%B3%D8%A7%D8%AE%D8%AA-%DA%AF%DB%8C%D9%85-%D8%A2%D9%88%D8%B1
۹۴/۰۵/۰۵