469,651 Members | 1,647 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,651 developers. It's quick & easy.

URI formats are not supported

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/de...ormtopic16.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);
....
Nov 12 '05 #1
2 20511
FileStream is just for local files. Use System.Net.WebRequest instead.

"K riley" <el******@netscape.net> wrote in message
news:ud**************@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/de...ormtopic16.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);
...

Nov 12 '05 #2

Thank you.

What I ended up doing is using the Revolver to accomplish my task

// Create a resolver with default credentials.
XmlUrlResolver resolver = new XmlUrlResolver();
resolver.Credentials = System.Net.CredentialCache.DefaultCredentials;

// Create the XslTransform object.
XslTransform xslt = new XslTransform();

// Load the stylesheet.
xslt.Load("http://localhost/MyWebApplication/file.xsl", resolver);

// Transform the file.
xslt.Transform(Server.MapPath("xmlfile.xml"),
Server.MapPath("xmltohtml.html"), resolver);

Chris Lovett wrote:
FileStream is just for local files. Use System.Net.WebRequest instead.

"K riley" <el******@netscape.net> wrote in message
news:ud**************@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/de...ormtopic16.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);
...


Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by VB Programmer | last post: by
4 posts views Thread by Lou Civitella | last post: by
1 post views Thread by msnews | last post: by
2 posts views Thread by Mel | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.