0

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

2

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

https://www.youtube.com/watch?v=9iK8IPUB87w

http://www.sharepoint-journey.com/visual-webpart-in-sharepoint-2013.html

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 mySourceDoc.Load(receiveStream); //close the stream receiveStream.Close() 

see link

2
  • 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. Commented 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." Commented Aug 8, 2014 at 10:46
0

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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.