473,800 Members | 2,414 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 21029
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
12994
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
9885
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: System.ArgumentException: URI formats are not supported.
4
9701
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) xmlDoc.GetElementsByTagName("Server").ItemOf(0).InnerXml =
4
1433
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
3037
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 Gupte
2
3276
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
2940
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 (end-user capability in contrast to developer implementation)? Also, is it possible to save an image in...
0
971
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
9690
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10275
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10253
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
10033
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.