I have tried to use the Map2Xml class to convert the map created by DBUtils.ExecuteJSON to xml but i get a dom exception. I looked at the Map2Xml example but it does not appear materially different.
Do I need to load a schema into the Map2Xml using the Class_Globals property? If so, how?
ls_sql = "SELECT ..."
Dim ls_fields As List = Array(DBUtils.DB_INTEGER, DBUtils.DB_INTEGER, .. etc )
Dim lsxml As String
Dim ls_args() As String = Null
Dim li_limit As Int = 10000
Dim gen As JSONGenerator
Dim m As Map
Dim mtx As Map2Xml
m = DBUtils.ExecuteJSON(SQL1, ls_sql, ls_args, li_limit, ls_fields)
gen.Initialize(m)
mtx.Initialize()
lsxml = mtx.MapToXml(m) ' crashes here
This crashes with error message
Error occurred on line: 52 (Map2Xml)
org.w3c.dom.DOMException: 890090
at org.apache.harmony.xml.dom.NodeImpl.setName(NodeImpl.java:286)
at org.apache.harmony.xml.dom.ElementImpl.<init>(ElementImpl.java:56)
at org.apache.harmony.xml.dom.DocumentImpl.createElement(DocumentImpl.java:343)
at org.apache.harmony.xml.dom.DocumentImpl.createElement(DocumentImpl.java:48)
at com.jamesmurty.utils.XMLBuilder.element2(XMLBuilder.java:477)
at com.jamesmurty.utils.XMLBuilder.element(XMLBuilder.java:420)
at Merit.FMSPortal.map2xml._handleelement(map2xml.java:96)
at Merit.FMSPortal.map2xml._handlemapelement(map2xml.java:166)
at Merit.FMSPortal.map2xml._handleelement(map2xml.java:81)
at Merit.FMSPortal.map2xml._handlelistelement(map2xml.java:192)
at Merit.FMSPortal.map2xml._handleelement(map2xml.java:92)
at Merit.FMSPortal.map2xml._maptoxml(map2xml.java:234)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:205)
at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:262)
Does anyone know what the issue is?