XMLDocument.LoadXML
From Xojo Documentation
Method
Parses the passed XML string into the document.
Method
Parses the passed XML file into the document.
Notes
Always check for an XMLException when loading XML from strings or files.
Examples
This example loads the following XML, contained in a constant called kTestXml, into a new XMLDocument:
<?xml version="1.0" encoding="UTF-8"?> <League> <Team name="Seagulls"> <Player name="Bob" position="1B" /> <Player name="Tom" position="2B" /> </Team> <Team name="Pigeons"> <Player name="Bill" position="1B" /> <Player name="Tim" position="2B" /> </Team> <Team name="Crows"> <Player name="Ben" position="1B" /> <Player name="Ty" position="2B" /> </Team> </League>
// Load XML
Var xml As New XmlDocument
Try
xml.LoadXml(kTestXml)
Catch e As XmlException
MessageBox("XML error: " + e.Message)
End Try
Var xml As New XmlDocument
Try
xml.LoadXml(kTestXml)
Catch e As XmlException
MessageBox("XML error: " + e.Message)
End Try
This example prompts the user to choose an XML file to load: