I added TestXML.xml together with simple.xls file to my Resources folder. Now I want to display the xml
styled according to the xsl
file.
string fileName = "TestXML.xml";
string localDocUrl = Path.Combine (NSBundle.MainBundle.BundlePath, fileName);
NSUrl url = new NSUrl (localDocUrl, false);
NSData xml = NSData.FromUrl (url);
string contentDirectoryPath = NSBundle.MainBundle.BundlePath;
NSUrl baseURL = new NSUrl (contentDirectoryPath, true);
webView.LoadData (xml, "text/xml", "UTF-8", baseURL);
webView.ScalesPageToFit = false;
If I execute the code above I get an empty page. How do I load the styled XML file onto my UIWebView
?
EDIT
Now I tried to load a web ressource:
string fileName = "http://www.w3schools.com/xml/simplexsl.xml";
NSUrl url = new NSUrl(fileName);
NSMutableUrlRequest request = new NSMutableUrlRequest (url, NSUrlRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData, 10);
webView.LoadRequest(request);
Here the xml file is correctly loaded with the xsl file. But how could I use a string or a local file for displaying it in the UIWebView
?