I am stuck in firstly creating a simple xslt. stylesheet to use for transforming an xml object.Secondly I am stuck in actually using the xslt stylesheet to do the transformation.
The background is the following:
I have a web part which is essentially a small form that has three inputs. These inputs then get submitted and used to query an external API by Http GET request. The results of the query then are displayed on a separate page in XML format. What I now need is to transform the xml to html and output that instead of the XML.
What I currently have:
I have a string variable "tmp" that holds the results from an api query by http get request. The results of the query get stored in the variable and I am able to display the results using: (Code given are small snippets of the whole code which are the most relevant for this particular case)
StreamReader reader = new StreamReader(response.GetResponseStream());
string tmp = reader.ReadToEnd();
Response.Write(tmp);
Response.End();
I then use "tmp" as an XML document object like so:
XmlDocument doc = new XmlDocument();
doc.Load(tmp);
To my project I then added an xslt file that will be used for the transformation.
Here is where I am stuck:
I have created the XML document object as listed above. How do I then proceed to use the XSLT file I have added to my project to do the transformation?
How do I actually achieve the transformation to have the output transformed to HTML.
I have been struggling with this for the best part of a week now.