Hi, I am new to this Forum and I hope my question is not out of scope. The following 4 lines of C# code allow me output specific fields from my XML to an HTML file (result.html). The code works fine when I have an XML file (sample1.xml) and an XSLT file (sample1.xslt) as an input. Now I want to modify this code to be able to input a string (the same XML code) instead of an actual XML file.
XPathDocument myXPathDoc = new XPathDocument("sample1.xslt"); XslTransform myXslTrans = new XslTransform(); myXslTrans.Load("sample1.xslt"); XmlTextWriter myWriter = new XmlTextWriter("result.html", null); myXslTrans.Transform(myXPathDoc, null, myWriter);
I am looking for a way to stream a string to that XPathDocument() or any other solution is welcome...