Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • D-au 26 posts 76 karma points
    Nov 27, 2012 @ 07:36
    D-au
    0

    XSLT search 2.8 error

    Hi guys so I just installed xsltsearch 2.8 for my 4.6 umbraco. I'm still using the old xslt schema btw.

    Strange thing is that the package keeps giving an error parsing. Using the "?umbDebugShowTrace=true". These error lines come up:

    Execution of scripts was prohibited. Use the XsltSettings.EnableScript property to enable it. An error occurred at \\n5200-2\iis7_www\p\r\thesite.net.au\www\xslt\XSLTsearch.xslt(30,2).
    Execution of scripts was prohibited. Use the XsltSettings.EnableScript property to enable it. An error occurred at \\n5200-2\iis7_www\p\r\thesite.net.au\www\xslt\XSLTsearch.xslt(30,2).
      at System.Xml.Xsl.Runtime.XmlQueryRuntime.ThrowException(String text)
      at System.Xml.Xsl.CompiledQuery.Query.startTime(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) in \\n5200-2\iis7_www\p\r\thesite.net.au\www\xslt\XSLTsearch.xslt:line 30
      at System.Xml.Xsl.CompiledQuery.Query.Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
      at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results)
      at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer)
      at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver)
      at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
      at umbraco.macro.GetXsltTransformResult(XmlDocument macroXML, XslCompiledTransform xslt, Dictionary`2 parameters)
      at umbraco.macro.loadMacroXSLT(macro macro, MacroModel model, Hashtable pageElements)

    Any thoughts?

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Nov 27, 2012 @ 09:16
    Chriztian Steinmeier
    0

    Hi D-au,

    It looks like it's not happy with the <msxml:script> tags (understandably) - AFAIK version 3 changed to use an App_Code extension for the extension functions.

    I don't know if the v3 functions map directly to the functions in the version you're running (presumably because you're still on the old schema, right?), if they do, you'd theoretically be able to remove the script tags from XSLTsearch.xslt, and take the XSLTsearch.cs file from v3 and put that in the /App_Code/ folder to make it work.

    (I'd be very surprised if that was all you'd need to do, though...)

    Best advice would be to check with Douglas Robar who developed XSLTsearch - he just might have had a request or two like this before.

    /Chriztian

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Nov 27, 2012 @ 09:19
    Chriztian Steinmeier
    0

    Another option:

    Use Doug's own guide to take the actual extensions from the XSLTsearch.xslt file into an App_Code extension - that should probably just work.

    /Chriztian

  • D-au 26 posts 76 karma points
    Nov 28, 2012 @ 00:48
    D-au
    0

    Hi Chriztian,

    Thanks for the reply, I did what the tutorial says. But the specific App_Code extension does not shown in whe I tried to insert the xslt:value of "PS.Helpers" that I just created and located in the "App_Code" folder.

    Any ideas what I'm missing? It is basically the last step of the tutorial

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Nov 28, 2012 @ 07:58
    Chriztian Steinmeier
    0

    Hi D-au,

    Do you get the PS.Helpers (or whatever you named the class) in the dialog but no available methods, or are you getting nothing at all?

    Did you remember to make the method(s) public static ?

    /Chriztian

     

  • D-au 26 posts 76 karma points
    Nov 28, 2012 @ 08:18
    D-au
    0

    Hi Chriztian,

    I'm getting nothing at all, sadly. 

    In summary what I need to do was only create a "cs" file in "App_Code" folder and it suppose to pop up in the extension, if that is correct?
    I've literally copied pasted Doug's code, however "PS.Helpers.cs" doesn't show on the extension - at all.

     ============================================================================

     

     

    using System;

    using System.Collections;

    using System.IO;

    using System.Web;

    using umbraco;

     

     

    namespace ps

    {

        [XsltExtension]

        public class Helpers

        {

            public Helpers() { }

            public static String uploadFileSize(String filePath)

            {

                if ((filePath != null) && (filePath.Length != 0))

                {

                    String localFile = HttpContext.Current.Server.MapPath(filePath);

                    if (File.Exists(localFile))

                    {

                        FileInfo fileinfo = new FileInfo(localFile);

                        return String.Format("{0:#,###,###.##}", (fileinfo.Length / 1024));

                    }

                }

                return null;

            }

        }

    }

     ============================================================================

     

     

  • D-au 26 posts 76 karma points
    Dec 04, 2012 @ 06:37
    D-au
    0

    Hi Guys,

    So according to:

    http://our.umbraco.org/projects/website-utilities/xsltsearch/xsltsearch-bugs/16139-Error-when-saving-XSLT-file-in-Umbraco-46-beta

    I'm missing the System.Web.Mvc.dll that cause the xslt extension to work.
    I've done everything mentioned in above thread but still stuck in the same place. Any other ideas, since I still could not access hte XSLTSearch.cs file in App_Code folder from the developer>xslt extension section? 

     

Please Sign in or register to post replies

Write your reply to:

Draft