Android Question Read xml string directly to table

GeoffT660

Active Member
Licensed User
Longtime User
Looking for direction on how to read xml received to a string from job.GetString into the sax xml parser and then write the output to a table as easily as possible. Currently I have this code to parse the xml but it throws an error
Parser.Parse2(s, \
javac 1.7.0_71
src\b4a\BizNow\getdata.java:413: error: inconvertible types
mostCurrent._parser.Parse2((java.io.Reader)(_s),"Parser");

Dim s As String
s=Job.GetString
Log(s)
Parser.Parse2(s, "Parser")
 

GeoffT660

Active Member
Licensed User
Longtime User
Looking for direction on how to read xml received to a string from job.GetString into the sax xml parser and then write the output to a table as easily as possible. Currently I have this code to parse the xml but it throws an error
Parser.Parse2(s, \
javac 1.7.0_71
src\b4a\BizNow\getdata.java:413: error: inconvertible types
mostCurrent._parser.Parse2((java.io.Reader)(_s),"Parser");

Dim s As String
s=Job.GetString
Log(s)
Parser.Parse2(s, "Parser")
 
Upvote 0

GeoffT660

Active Member
Licensed User
Longtime User
This is all being done in the JobDone Sub
Would I still have s as:
Dim s As String
s=job.GetString

I currently have:
If job.Success = True Then
Dim s As String
s=job.GetString
Dim bytes() AsByte = s.GetBytes("utf8")
Dim InAsInputStream
In.InitializeFromBytesArray(bytes, 0, bytes.Length)
Parser.Parse(In, "Parser")

But then I get this error:
JobName = Job1, Success = true
java.lang.NullPointerException
at anywheresoftware.b4a.objects.SaxParser.parse(SaxParser.java:78)
at anywheresoftware.b4a.objects.SaxParser.Parse(SaxParser.java:73)
at b4a.BizNow.getdata._jobdone(getdata.java:474)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
at anywheresoftware.b4a.keywords.Common$5.run(Common.java:962)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5074)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
 
Upvote 0
Top