views:

242

answers:

2

Hey,

I’m looking to load data from an XML file that is external to the xap file but stored within the same folder.

My experiences with loading XML are that the XDocument class is used, but this only accepts location string. This is fine if the xml file is contained within the XAP but i need it to be loaded external, regardless of the site the whole project is hosted on

I hope that makes sense and any help would be great :)

+2  A: 

You can use a WebClient and its DownloadStringAsync method, then use the XDocument.Parse or XElement.Parse to parse the downloaded string into a DOM. Please note however, that Silverlight will not allow you to access a resource (including an XML file over HTTP) that is on another domain unless there is a cross domain policy file in the root of that domain.

Josh Einstein
Are you a relative of Albert Einstein?
vtd-xml-author
I've never looked into it but it's possible that his uncle Jakob could be a link.
Josh Einstein