Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 562621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:34:26+00:00 2026-05-13T12:34:26+00:00

There are two XSL files. One includes another using an <xsl:include> . The main

  • 0

There are two XSL files. One includes another using an <xsl:include>. The main template decides which actual templates to call depending on node values, and included templates contain actual transformation rules. Nothing special here.

But included file has a script block:

  <msxsl:script language="VB" implements-prefix="user">
    <msxsl:assembly href="C:\Absolute\Path\MyEscaper.dll" />
    <msxsl:using namespace="ZebraEscaper.MyCompany" />
    <![CDATA[
    Public Function escape(s As String) As String
      Return EncodeField(s, True)
    End Function
    ]]>
  </msxsl:script>

The user:escape() function is later used in the included template.

Now, I go to VS2008 XSLT debugger.

The main template calls <xsl:apply-templates> and the included template executes. And a FileNotFound exception occurs, “Could not load file or assembly ‘MyEscaper, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. The system cannot find the file specified.”

Now, if I go to just the included file and execute it as if it was a standalone template, not included into anything, everything works. The assembly gets found and the function gets called, but obviously results don’t make sense as the template designed to be an inclusion.

So the question — why can’t the system find the assembly when the template is included?

More information

Documentation states that “The assembly path name is resolved twice – once during compilation and once during execution.” If I intentionally make a typo in the path, I get same FileNotFound exception, but formatted differently, where the system says it cannot find file://C:\Absolute\Path\MyEscaper.dll. However, when the path is correct, the exception claims it couldn’t find MyEscaper.dll, version=blabla, public token=null, and that exception occurs in CompiledStylesheet.dll created by .Net. I believe that the compiled stylesheet is told to call the assembly by name, not by href, and since it’s not in its temporary folder, the call fails.

Why so? Where and why does an absolute path get translated (wrongly) into a relative one, and how do I control it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T12:34:26+00:00Added an answer on May 13, 2026 at 12:34 pm

    So.

    For some reason, in an included scenario path to the assembly is resolved differently during compilation and during execution. Why it is so, I haven’t got a clue.

    Only two sane solutions were found:

    1. Move all code from the referenced assembly into the XSL template, making it an embedded script. In case of small helper functions that is actually preferred. Otherwise,

    2. Sign the referenced assembly with a strong name, add it to the GAC, and refer to it from templates using name, not href. This way the assembly will be looked up in the same way during compilation and execution, and will be found.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 269k
  • Answers 269k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer A lot of it depends on the platform and compiler… May 13, 2026 at 1:23 pm
  • Editorial Team
    Editorial Team added an answer Yes. Use the overload String.Split(String[], StringSplitOptions) or String.Split(String[], int, StringSplitOptions)… May 13, 2026 at 1:23 pm
  • Editorial Team
    Editorial Team added an answer Normally you would use for example a recursive descent parser… May 13, 2026 at 1:23 pm

Related Questions

I'm attempting to do a transform on an XML document. My XML transform can
So we have this web app where we support UTF8 data. Hooray UTF8. And
I am total noob with XSL and XSL-FO and I am looking for some
I want to translate an XML file with data like the following: <FlatData> <Details1_Collection>
I've come across the following snippet in an XSL file that I'm working with.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.