473,398 Members | 2,525 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,398 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 20950
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.