// Create a resolver with default credentials.
// Create the XslTransform object.
// Load the stylesheet.
// Transform the file.
Chris Lovett wrote:
> FileStream is just for local files. Use System.Net.WebRequest instead.
>
> "K riley" <elvisktr@netscape.net> wrote in message
> news:udC3ELBqFHA.1556@TK2MSFTNGP12.phx.gbl...
>
>>Hi.
>>
>>I am trying to use the XslTranfrom object and I am getting an unhandled
>>expection.
>>URI formats are not supported
>>Exception Details: System.ArgumentException: URI formats are not
>>supported.
>>
>>I am following the example as layed out by Microsoft for C#
>>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemxmlxslxsltransformclasstransformtopic16.asp
>>
>>From the error stack I believe the error is occurring when I try to create
>>the FileStream
>>FileStream fs = new
>>FileStream("http://localhost/MyWebApplication/cust.html",
>>FileMode.Create);
>>
>>I checked permissions on my web server and have given the iusr account the
>>ability to create/delete/edit files. I did this thinking it was a
>>permissions
>>
>>Thanks in advance for any help.
>>
>>My Code
>>....
>>
>>XmlTextReader xtr = new
>>XmlTextReader("http://localhost/MyWebApplication/asucPartial.xml");
>>xtr.WhitespaceHandling = WhitespaceHandling.None;
>>
>>XmlDocument xd = new XmlDocument();
>>xd.Load(xtr);
>>
>>XslTransform xslt = new XslTransform();
>>xslt.Load("http://localhost/MyWebApplication/ASUC1.xsl");
>>
>>
>>//From Microsoft
>>// Create an XPathNavigator to use in the transform.
>>XPathNavigator nav = xd.CreateNavigator();
>>
>>// Create a FileStream object.
>>//FileStream fs = new
>>FileStream("http://localhost/MyWebApplication/cust.html",
>>FileMode.Create);
>>
>>FileStream fs = new
>>FileStream("http://localhost/MyWebApplication/cust.html",
>>FileMode.CreateNew);
>>
>>// Transform the data.
>>xslt.Transform(nav, null, fs, null);
>>...
>
>