473,387 Members | 1,799 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,387 software developers and data experts.

"the uri scheme is not valid" error when working with XslTransformload method

Hi All

I've decided to put my stylesheets in a base64 .resource file for
deployment and versioning reasons. I dont know if it's a great idea to
do this but I couldn't think of another way of doing this other than
making them available via www which may or may not be accessible (so
this is a no go). Bear with me because I've only been using C# for one
day so far (today is day 2! wohoo).

// begin code snippet

XslTransform xslt = new XslTransform();

// put stylesheet in a string variable
ResourceManager rManager=newResourceManager("abcd.StyleSheets",
Assembly.GetExecutingAssembly());

//Load the stylesheet.
xslt.Load(resourceManager.GetString("0"));

// end code snippet

Here I get an error on the Load method which I'm guessing is because the
load method expects a filename not the raw XML.

Is there a method which accepts raw XML within the System.Xml.Xsl?
A LoadXML method would be what I'm looking for, alternatively if some
kind soul could offer me some opinion on some other way to do what I need?
Apr 19 '06 #1
2 4269


Mr Flibble wrote:

XslTransform xslt = new XslTransform();

// put stylesheet in a string variable
ResourceManager rManager=newResourceManager("abcd.StyleSheets",
Assembly.GetExecutingAssembly());

//Load the stylesheet.
xslt.Load(resourceManager.GetString("0")); Is there a method which accepts raw XML within the System.Xml.Xsl?
A LoadXML method would be what I'm looking for,


If that method gives you a string with the XML markup of the XSLT
stylesheet then you can use an XmlTextReader over a StringReader e.g.
xslt.Load(new XmlTextReader(new
StringReader(resourceManager.GetString("0")))

Note also that with ASP.NET 1.1 some overloads of the Load method are
obsolete, you might want to use a method taking additional parameters
(besides the XmlReader) where you pass in an XmlResolver and Evidence to
control how xsl:include/import are resolved and how/whether script in
the stylesheet is allowed.


--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Apr 19 '06 #2

"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:Ox**************@TK2MSFTNGP05.phx.gbl...


Mr Flibble wrote:

XslTransform xslt = new XslTransform();

// put stylesheet in a string variable
ResourceManager rManager=newResourceManager("abcd.StyleSheets",
Assembly.GetExecutingAssembly());

//Load the stylesheet.
xslt.Load(resourceManager.GetString("0"));

Is there a method which accepts raw XML within the System.Xml.Xsl?
A LoadXML method would be what I'm looking for,


If that method gives you a string with the XML markup of the XSLT
stylesheet then you can use an XmlTextReader over a StringReader e.g.
xslt.Load(new XmlTextReader(new
StringReader(resourceManager.GetString("0")))

Note also that with ASP.NET 1.1 some overloads of the Load method are
obsolete, you might want to use a method taking additional parameters
(besides the XmlReader) where you pass in an XmlResolver and Evidence to
control how xsl:include/import are resolved and how/whether script in the
stylesheet is allowed.


Yeah, I used this:

XslTransform transform = new XslTransform();
XmlTextReader textReader = new XmlTextReader(strXSLT, XmlNodeType.Document,
null);
transform.Load(textReader, null, null);

where strXSLT contains the XSLT XML markup as a string!
Apr 19 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Michelle Kinsey-Clinton | last post by:
Hello, I am writing an ASP app which is giving me some very frustrating errors. They appear intermittently, no real pattern to them, and often go away if you reload, or back up a few pages and...
0
by: James Lavery | last post by:
Hi all, We've got a vb.net assembly (dll), which is exposing a COM interface so it can be called from our legacy VB6 application. When we call a particular method (which is designed to return...
34
by: Pmb | last post by:
I've been working on creating a Complex class for my own learning purpose (learn through doing etc.). I'm once again puzzled about something. I can't figure out how to overload the assignment...
7
by: Jim Bancroft | last post by:
Hi everyone, A basic one here, I think. I haven't found the pattern yet, but sometimes when I cast a variable to another type using the "C" style cast operator the compiler refuses to play...
0
by: Alex | last post by:
my app was working fine in VB.NET 2003 (and framework 1.1). Now with VB.NET 2005 (framework 2.0) the uploading to an http server (ie. www.sharebigfile.com) stops with the error "The request was...
0
by: Hawksey | last post by:
Hello, Has anyone else experienced a similar problem. We get an intermittent error trying to send mail using smtpmail. Our SmtpMail.SmtpServer is a different server to our web application...
9
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a...
3
by: martin | last post by:
Hello, Could someone here please explain the reason for the error in the subject (the full error below) I dont get this everytime and i've never gotten while debugging. The code (also below)...
1
by: LiveCycle | last post by:
Hi, I've got a longstanding project that's been working fine for about a year. I was working on one of the pages, a simple download page. After making a little tweak on the page, I tried to...
1
by: sandeepbhutani304 | last post by:
have 2 projects communicating each other with .NET remoting. But when I am trying to call these functions I am getting the error: The input stream is not a valid binary format. The starting...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
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...

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.