TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
spjewett
NA
5
0
Embedding XSLTs in a C# Project
Oct 26 2004 10:48 PM
I'm using an XSLT to transform an "in-memory" XML document into an HTML file. The following code performs the transformation without any problems, but it relies on a hard-coded path: XPathNavigator nav = xmlDocRoot.CreateNavigator(); XslTransform xslt = new XslTransform(); xslt.Load("C:/SomeFolder/AnotherFolder/MyXSLT.xslt"); XmlTextWriter htmlPage = new XmlTextWriter(htmlBaseFilename + ".html", null); xslt.Transform(nav, null, htmlPage, null); Replacing the Load method call with the following call works, provided the XSLT is located in the working folder for the app, and it eliminates the need for a hard-coded path: xslt.Load("MyXSLT.xslt"); What I really would like to do is embed the XSLT as a resource in the project (no worries about the file getting deleted or modified by some over zealous user), but I haven't had any luck doing so. Some of Microsoft's documentation describes adding the XSLT file to the project, setting the Build property to Embedded Resource, and calling methods from the "GetManifestResource..." group on the executing assembly, but I can't seem to get it to work. Any ideas on how to embed the XSLT in the project?
Reply
Answers (
2
)
Performance in debug mode (F5) vs. no debugging (Ctrl+F5)
Sending IP Packet ?