Saving Xml File Location as Property?

I am wanting to save the location of a XML file I get with a OpenDialog as a property and later retrieve that information in the method I have that decodes the XML file.

My Code: (Method that opens the XML File (“OpenFileDIalog”))

[code] Dim OpenXml As OpenDialog
Dim TheFileToOpen As FolderItem

OpenXml = New OpenDialog

#If Not (TargetLinux)
OpenXml.InitialDirectory = SpecialFolder.Documents
#else
OpenXml.InitialDirectory = SpecialFolder.Home
#endif

OpenXml.Title = “Open a Riivolution XML File”
OpenXml.Filter = FileTypes1.RiivolutionXMLFile

TheFileToOpen = OpenXml.ShowModalWithin(MainWindow)

if TheFileToOpen <> Nil then
FileLocation = TheFileToOpen.URLPath
DecodeXmlFile //The Method
end if[/code]

My Code: (Method that decodes the XML File (“DecodeXmlFile”))

Dim TheFile As XmlDocument TheFile.Value = FileLocation

For “FileLocation = TheFileToOpen.URLPath” I am getting error “Expected string, got XmlDocument”.
For “TheFile.Value = FileLocation” I am getting error “Expected XmlDocument got String”.

Thanks.

The XMLDocument.Value method can’t be used to instantiate an XMLDocument; you need to use one of XMLDocument’s Constructor methods. There are several constructors, one of them accepts an XML file as a FolderItem:

Dim TheFile As XmlDocument 
TheFile = New XMLDocument(TheFileToOpen) ' Using "new" to call the constructor with the file as an argument