473,561 Members | 3,133 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Argument Exception: 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("htt p://localhost/MyWebApplicatio n/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/MyWebApplicatio n/asucPartial.xml ");
xtr.WhitespaceH andling = WhitespaceHandl ing.None;

XmlDocument xd = new XmlDocument();
xd.Load(xtr);

XslTransform xslt = new XslTransform();
xslt.Load("http ://localhost/MyWebApplicatio n/ASUC1.xsl");
//From Microsoft
// Create an XPathNavigator to use in the transform.
XPathNavigator nav = xd.CreateNaviga tor();

// Create a FileStream object.
//FileStream fs = new
FileStream("htt p://localhost/MyWebApplicatio n/cust.html", FileMode.Create );

FileStream fs = new
FileStream("htt p://localhost/MyWebApplicatio n/cust.html",
FileMode.Create New);

// Transform the data.
xslt.Transform( nav, null, fs, null);
....
Nov 12 '05 #1
2 20975
FileStream is just for local files. Use System.Net.WebR equest instead.

"K riley" <el******@netsc ape.net> wrote in message
news:ud******** ******@TK2MSFTN GP12.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.Argument Exception: 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("htt p://localhost/MyWebApplicatio n/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/MyWebApplicatio n/asucPartial.xml ");
xtr.WhitespaceH andling = WhitespaceHandl ing.None;

XmlDocument xd = new XmlDocument();
xd.Load(xtr);

XslTransform xslt = new XslTransform();
xslt.Load("http ://localhost/MyWebApplicatio n/ASUC1.xsl");
//From Microsoft
// Create an XPathNavigator to use in the transform.
XPathNavigator nav = xd.CreateNaviga tor();

// Create a FileStream object.
//FileStream fs = new
FileStream("htt p://localhost/MyWebApplicatio n/cust.html",
FileMode.Create );

FileStream fs = new
FileStream("htt p://localhost/MyWebApplicatio n/cust.html",
FileMode.Create New);

// 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.Creden tials = System.Net.Cred entialCache.Def aultCredentials ;

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

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

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

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

"K riley" <el******@netsc ape.net> wrote in message
news:ud******** ******@TK2MSFTN GP12.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.Argument Exception: 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("h ttp://localhost/MyWebApplicatio n/cust.html",
FileMode.Crea te);

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
....

XmlTextRead er xtr = new
XmlTextReader ("http://localhost/MyWebApplicatio n/asucPartial.xml ");
xtr.Whitespac eHandling = WhitespaceHandl ing.None;

XmlDocument xd = new XmlDocument();
xd.Load(xtr );

XslTransfor m xslt = new XslTransform();
xslt.Load("ht tp://localhost/MyWebApplicatio n/ASUC1.xsl");
//From Microsoft
// Create an XPathNavigator to use in the transform.
XPathNavigato r nav = xd.CreateNaviga tor();

// Create a FileStream object.
//FileStream fs = new
FileStream("h ttp://localhost/MyWebApplicatio n/cust.html",
FileMode.Crea te);

FileStream fs = new
FileStream("h ttp://localhost/MyWebApplicatio n/cust.html",
FileMode.Crea teNew);

// Transform the data.
xslt.Transfor m(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
12979
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 Problem is PictureBox1.Image = Image.FromFile("http://www.zeetelevision.com/images/today.jpg"); Its giving me error, URI path not supported..
1
9860
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 current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details:...
4
9688
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 = Path.GetDirectoryName(.GetExecutingAssembly.GetName.CodeBase) & "\Config.xml" xmlDoc.Load(strAppWorkingDir)...
4
1420
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 formats. (they should be all of the formats, regardless the regional settings) Regards
1
689
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). //-------------------------------------------------------------------- string m_image_path = "http://www.abc.com/image/1234.jpg"; //sample filename
0
3029
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 using GIF images, because as far as I could tell JPG did not work. Should I be using any other format? Anyway around this error? Thanx, -- Anil...
2
3267
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. Public Shared wkbExcel As SpreadsheetGear.IWorkbook =SpreadsheetGear.Factory.GetWorkbook("http:\\myport.mydomain.com \spreadsheets\span tables.xls")
2
2909
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 on the .NET Framework used (e.g., the Image class defines which formats can be used), or can different file formats be added after-the-fact...
0
958
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
7558
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7851
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7605
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7924
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6195
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3591
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2055
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1171
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
884
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.