Sub Process_Globals
Dim parser AsSaxParser
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim FOUND_SEC As Int
Dim key2find AsString
Dim webview1 AsWebView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("aaaq")
If FirstTime Then
parser.Initialize
EndIf
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Parser_StartElement (UriAsString, Name AsString, AttributesAsAttributes)
If Name = "section"Then
IfAttributes.GetValue(0)=key2find Then
FOUND_SEC=1
Msgbox(Uri,"")
Else
FOUND_SEC=0
EndIf
EndIf
End Sub
Sub Parser_EndElement (UriAsString, Name AsString, Text AsStringBuilder)
If Name = "section"And FOUND_SEC=1Then
FOUND_SEC=0
webview1.LoadHtml (Text.ToString)
EndIf
End Sub
Sub retrieve_key( akey AsString)
key2find=akey
DiminAsInputStream
in = File.OpenInput(File.DirAssets, "index.xml")
parser.Parse(in, "Parser")
in.Close
End Sub
Sub Button2_Click
retrieve_key("ob1.html")
End Sub
Sub Button3_Click
retrieve_key("ob2.html")
End Sub
Sub Button4_Click
retrieve_key("ob3.html")
End Sub