473,386 Members | 1,745 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,386 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 1776


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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.