3

I have a string var that store an xml from a request to a RESTful service.

I have a problem transforming this with an xslt file on a fly without saving it.

I am getting this error

System.UriFormatException: Invalid URI: The Uri scheme is too long. On this line

xslt.Transform(xmldoc, null, writer);

string xmldoc = xReq("http://restful.com/RestAPI");

XslCompiledTransform xslt = new XslCompiledTransform();

xslt.Load(@"C:\Users\XSeXml\xRes.xslt");

string htmlOutput;

StringWriter writer = new StringWriter();

xslt.Transform(xmldoc, null, writer);

htmlOutput = writer.ToString();

Literal1.Text = htmlOutput;

writer.Close(); 
David Pilkington
  • 13,528
  • 3
  • 41
  • 73

1 Answers1

0

How to transform XML as a string w/o using files in .NET?

Ideas from the link above helps to overcome the problem by passing the string to the XmlReader before transforming it.

Community
  • 1
  • 1