473,385 Members | 2,269 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 20947
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: thedebugger | last post by:
Dear Friends, I am making one RSS News Reader Desktop application in c#. Where I will show the images from website. I am generating xml file on server. like http://www.zeetelevision.com/myxml.xml...
1
by: VB Programmer | last post by:
On this line of code: objStreamReader = File.OpenText(FILENAME) I get this error: URI formats are not supported. Description: An unhandled exception occurred during the execution of the...
4
by: Lou Civitella | last post by:
Using the following code I am trying to save changes to a xml from a VB.Net app. ' Save the changes to the config file. Dim xmlDoc As New XmlDocument Dim strAppWorkingDir As String =...
4
by: Sam | last post by:
Hi, I've already asked a kind of question like that, but it's a bit different this time. How can I get all of the supported numeric formats by Windows? I want to fill a combobox with those...
1
by: msnews | last post by:
Hi All, Requirement To get an image from web server A, resize the image and then save it at our web server B (our server). ...
0
by: Anil Gupte | last post by:
I am using an Image Button from Microsoft's Power Pack. When I use the ..Enabled=True/False I get the following error "SetPixel is not supported for images with indexed pixel formats" I am...
2
by: Mel | last post by:
I am getting this error when I try to declare an object as an Excel workbook. Can anyone tell me how to fix it? I have placed the Excel file on the server in the "spreadsheets" directory. ...
2
by: Peter Oliphant | last post by:
The Image class allows loading a bitmap from a graphic file. So far I've gotten it to work with JPG and BMP files. What other graphic file formats are supported in this way? Is this fixed based...
0
by: Sameera | last post by:
Hi, Could any one help me out on how to retriveing the supported formats for the installed Word version in C#. Thanks
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.