Using external objects within XSLT C# script.

Posted on 2006-04-13
Last Modified: 2008-03-17
I have an XSLT script that I'm trying to use and inside the script I need to use an external object that I have created, but everytime I
add the following line to reference the object:

<msxsl:using namespace="MyNamepace" />

to my script I get the following error:

Exception.Message = file:///C:/Documents and Settings/Jason Herron/My Documents/Visual Studio Projects/XSLTransformWithCSharpScript/XSLTransformWithCSharpScript/XSLTFile1.xslt(7,55) :\n
Exception.InnerException = msxsl:script cannot be empty.

I'm trying to do something along these lines:

Even when I forget about my own external object and just try referencing the System.IO namespace, i get the same error.  When I pull the above line out the script works fine (well, it would work fine if I don't use any unknown objects).

Has anyone gotten this to work successfully?

An alternative I've tried is to add an Extension object to the XslTransform object, but I can't seem to figure out how to use that object in script.  I can only successfully use it inside the transforms.

Question by:xrimson77
    1 Comment
    LVL 37

    Accepted Solution


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    In one of my recent projects, I was working with IP cameras, I need to take some pictures from the camera and do some processing on it. The first step, was to retrieve the image from camera into Image object. So that it can be displayed or …
    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now