Viewing XML Files

I use Chilkat to make and read XML files. I like the way the program is structured. In this sample you can paste raw unformatted XML – Click XML Formatted will format the XML to a more readable format.  You can also use the same option with JSON Files.


Private Sub cmdSingle_Click()
If Nz(Me.Raw, "") = "" Then
    MsgBox "Enter some XML in the Raw section"
    Exit Sub
End If
Me.Formatted = SingleConvert(Me.Raw)

End Sub

Function SingleConvert(tmpRaw)
Dim tmpConvert, xml
    Set xml = CreateObject("Chilkat_9_5_0.Xml")
    tmpConvert = xml.loadXML(tmpRaw)
    SingleConvert = xml.GetXml()
End Function


<breakfast_menu> <food> <name>Belgian Waffles</name> <price>$5.95</price> <description>Two of our famous Belgian Waffles with plenty of real maple syrup</description> <calories>650</calories> </food> <food> <name>Strawberry Belgian Waffles</name> <price>$7.95</price> <description>Light Belgian waffles covered with strawberries and whipped cream</description> <calories>900</calories> </food> <food> <name>Berry-Berry Belgian Waffles</name> <price>$8.95</price> <description>Light Belgian waffles covered with an assortment of fresh berries and whipped cream</description> <calories>900</calories> </food> <food> <name>French Toast</name> <price>$4.50</price> <description>Thick slices made from our homemade sourdough bread</description> <calories>600</calories> </food> <food> <name>Homestyle Breakfast</name> <price>$6.95</price> <description>Two eggs, bacon or sausage, toast, and our ever-popular hash browns</description> <calories>950</calories> </food> </breakfast_menu>
Hi, I’m Pat