[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

How do I link/embed XSLT file and access the resource?

Posted on 2009-04-07
2
Medium Priority
?
783 Views
Last Modified: 2013-12-17
I am creating a windows application to select an XML file and use an XSLT template to apply formatting to that XML file.

I can currently provide a static path to the file, but I'd like to create a resource for this XSLT file so that I don't have to include the file after I compile the application.

I can't figure out how to use XslCompiledTransform's Load method to access a .resx file "Template.xsl" to load that file.

For sake of simplicity, assume namespace = ns and resource path = ns.Resources.Template.xsl

Any help would be great.
0
Comment
Question by:tbhodges
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
tbhodges earned 0 total points
ID: 24093499
I answered my own question I believe...

Read the ns.Resources.Template.xsl into a stream, and then created an XmlTextReader from the stream.    The Load method can take an XmlReader.

Let me know if you think of anything else that could be easier.
Stream myXSL = Assembly.GetExecutingAssembly().GetManifestResourceStream("ns.Resources.Template.xsl");
 
XmlReader myReader = new XmlTextReader(myXSL);

Open in new window

0
 
LVL 19

Assisted Solution

by:daveamour
daveamour earned 200 total points
ID: 24097923
Thats a bit clunky
This is better
http://msdn.microsoft.com/en-us/library/7k989cfy(VS.80).aspx
But when it says this:

You can add resources to a project by right-clicking the Properties node under your project in Solution Explorer, clicking Open, and then clicking the Add Resource button on the Resources page in Project Designer.
I thin that's wrong and you should right click on the Resources.resx in Properties
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question