Does this library only parse html tags? Is there anyway to parse other kind of document, like this one attached? I'm getting "org.apache.harmony.xml.ExpatParser$ParseException: At line 3, column 0: junk after document element".
Tks.
No. It parses well-formed xml files.
For xml to be well-formed it needs a single root node.
B4X:
Dim fileData As String = $"<Root>${File.ReadString(File.DirAssets, "washer.xml")}</Root>"$
Dim xm As Xml2Map
xm.Initialize
Private ParsedData As Map = xm.Parse(fileData)
Dim Root As Map = ParsedData.Get("Root")
Dim Geometry As Map = Root.Get("Geometry")
Log(GetElements(Geometry, "Face").Size) 'Log: 31
No. It parses well-formed xml files.
For xml to be well-formed it needs a single root node.
B4X:
Dim fileData As String = $"<Root>${File.ReadString(File.DirAssets, "washer.xml")}</Root>"$
Dim xm As Xml2Map
xm.Initialize
Private ParsedData As Map = xm.Parse(fileData)
Dim Root As Map = ParsedData.Get("Root")
Dim Geometry As Map = Root.Get("Geometry")
Log(GetElements(Geometry, "Face").Size) 'Log: 31