I am using sharepoint 2013. I have used the xml viewer webpart but I have to much trouble and limitations. I would like to build a visual webpart in Visual Studio. In this webpart I would like to read an xml file from url. And use my own xsl 2.0 . How can I do this?

2 Answers 2


Here are some links to create visual web part in visual studio :



There are multiple methods to capture XML from a URL, but this particular example is helpful when you are dealing with special characters of foreign languages. The loaded XML will display them in correct format for the charset specified.

//Include the following packages
using System.Net;
using System.IO;

//request the particular web page
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://feeds.feedburner.com/pointsharepoint?format=xml");

//define the login credentials of the requested file/page
request.Credentials = new NetworkCredential(”UserName”, “Password”);

//get the response from the request
HttpWebResponse response = (HttpWebResponse)request.GetResponse();

//create a stream to hold the contents of the response
Stream receiveStream = response.GetResponseStream();

//create your XML document
XmlDocument mySourceDoc = new XmlDocument();

//load the file from the stream

//close the stream

see link

  • I know how to create a visual webpart. But thats not my question. I would like to develop to read a xml file and print it in html in the webpart.
    – Ola
    Aug 8, 2014 at 10:42
  • 1
    Then you should rephrase the question, instead of giving people -1! " I would like to build a visual webpart in Visual Studio."
    – Plexus81
    Aug 8, 2014 at 10:46

I am facing the same challenge and I want to create a web part that can read an XML file and display it as HTML using XSLT in SharePoint Online. Could please share the solution if you are able to successfully implement the solution?

Thank you very much for your support.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.