iOS Question Is there an example for map2xml?

Lisa I

Member
Licensed User
I'm new to B4i and I have used xml2Map to import an xml file so I can edit it. I have changed the values in the map successfully and want to use the map2xml class to write it back to an xml. However I cannot work out how to use it.
Is there an easy example to follow?

Thank you
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4X:
Dim s As String = $"<?xml version="1.0" encoding="UTF-8"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note> "$
Dim x2m As Xml2Map
x2m.Initialize
Dim m As Map = x2m.Parse(s)
Log(m)
Dim note As Map = m.Get("note")
note.Put("to", "someone else")
Dim m2x As Map2Xml
m2x.Initialize
Dim xml As String = m2x.MapToXml(m)
Log(xml)
 
Upvote 0
Top