If File.Exists(File.DirApp,"temp.xml") Then File.Delete(File.DirApp,"temp.xml")
'save the contents first
File.WriteString(File.DirTemp,"temp.html",sText)
'parse with jtidy to convert to xml
tid.Initialize
'ensure it shows the output
Dim jo As JavaObject = tid
jo.GetFieldJO("tidy").RunMethod("setForceOutput", Array(True))
'parse the Html page and create a new xml document.
tid.Parse(File.OpenInput(File.DirTemp, "temp.html"), File.DirApp, "temp.xml")
'does the file exist, then parse it
Dim ParsedData As Map
ParsedData.Initialize
If File.Exists(File.DirApp,"temp.xml") Then
Dim xm As Xml2Map
xm.Initialize
ParsedData = xm.Parse(File.ReadString(File.dirapp, "temp.xml"))
End If
If ParsedData.ContainsKey("html") Then
Dim html As Map = ParsedData.Get("html")
Dim body As Map = html.Get("body")
''''
End If