Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 6th, 2008, 05:19 PM
Authorized User
 
Join Date: Jul 2008
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem when using script language c#

Hi All,

I have a script written in xslt in c# language. if i run the xslt file from .net code (loading xslt file dynamically) it is working fine. But when i give a reference to xslt file in an xml file and open it via double clicking it; it is throwing the error "Invalid class string". Any reason for this? Am i missing something?

Rakesh

 
Old August 6th, 2008, 05:29 PM
Authorized User
 
Join Date: Jul 2008
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Attching the code lines

<msxml:script language="C#" implements-prefix="user" >
        <![CDATA[

        /*This function will format the date to the format mm/dd/yyyy*/

            public String FormatDate(String date)
            {
                String dateValue = date.Trim();
                if (!String.Equals(dateValue,"0") || !String.IsNullOrEmpty(dateValue))
                {
                    return (dateValue.Substring(5,2) + "/" + dateValue.Substring(8,2) + "/" + dateValue.Substring(0,4));
                }
                else
                {
                    return String.Empty;
                }
            }

        ]]>
    </msxml:script>

 
Old August 6th, 2008, 05:52 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

My guess would be that when you double-click the XML file, the chosen XSLT processor is MSXML rather than the .net processor, and that this doesn't support C# "script".

Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference
 
Old August 7th, 2008, 02:00 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Heck, double clicking an XML file could run it in anything; Word, Infopath, Visual Studio, Notepad, IE/Firefox, the list of things I've seen as the default is quite long.

/- Sam Judson : Wrox Technical Editor -/





Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with the script ruchilalla J2EE 1 May 5th, 2005 03:56 AM
Problem With Script arimakidd Classic ASP Databases 1 March 11th, 2005 02:53 PM
Problem in C language prshant C++ Programming 0 February 4th, 2005 05:29 AM
Problem with Crystal Reports and Farsi Language! adik Crystal Reports 0 December 5th, 2004 02:00 AM
Problem with upload script jeremy108 BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 4 July 2nd, 2003 01:48 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.