Code: Select all
Structure Person
Name$
Age.l
List Books.s()
EndStructure
Define P.Person
P\Name$ = "John Smith " + Chr(17) + Chr(1) + " xxx" ; means [DC1] + [SOH]
P\Age = 42
AddElement(P\Books()): P\Books() = "Investing For Dummies"
AddElement(P\Books()): P\Books() = "A Little Bit of Everything For Dummies"
Debug P\Name$
Debug P\Age
If CreateXML(0)
InsertXMLStructure(RootXMLNode(0), @P, Person)
FormatXML(0, #PB_XML_ReFormat)
SaveXML(0, "test.xml")
FreeXML(0)
EndIf
If LoadXML(0, "test.xml")
ExtractXMLStructure(MainXMLNode(0), @P, Person)
FreeXML(0)
EndIf
Debug P\Name$
Debug P\Age
https://www.dropbox.com/s/gq6qi2jfvh0afkx/ascii-xml.png