Copied to clipboard

Flag this post as spam?

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


  • Ivan 139 posts 302 karma points
    Jun 25, 2010 @ 14:39
    Ivan
    0

    Please Help!! XSLT Parameter is driving me crazy

    Hi.

    I am doing a simple test for checking that Macro parameters are correctly parsed in my Umbraco 4.0.3 installation.
    Problem is no matter how many tests i do, macro parameter is never parsed.

    XSLT Code (Prueba.xslt)

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
        version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:msxml="urn:schemas-microsoft-com:xslt"
        xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">


    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>

    <xsl:variable name="parametro" select="/macro/parametro"/>

    <xsl:template match="/">

    Value of parameter is: <xsl:copy-of select="/macro/parametro"/>
    <br />
    Value of parameter is: <xsl:value-of select="$parametro"/>

    </xsl:template>

    </xsl:stylesheet>

    Macro Prueba (Alias = Prueba, use Prueba.xslt as xslt file) parameters defined

    Alias (parametro) Name (parametro) Type (text)

    Macro used in testing template

    <%@ Master Language="C#" MasterPageFile="/umbraco/masterpages/default.master" AutoEventWireup="true" %>

    <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
        <umbraco:Macro parametro="'Prueba'" Alias="Prueba" runat="server"></umbraco:Macro>
    </asp:Content>

    Results

    I am supposed to get following text as a result of use the macro: "Value of parameter is: Prueba".
    Fact is am getting nothing and that is driving me crazy.

    What am i doing wrong? Maybe my Umbraco installation is not working properly?

    Thanks a lot for your Help!!
    Ivan

  • Pat O'Callaghan 34 posts 56 karma points
    Jun 26, 2010 @ 03:33
    Pat O'Callaghan
    0

    Are you getting nothing at all or are you getting just "Value of parameter is:" with no "Prueba" value? in other words is the macro being called or not at all?

  • Nigel Wilson 945 posts 2077 karma points
    Jun 26, 2010 @ 08:10
    Nigel Wilson
    0

    Have you declared the parameters in the macro under "Devloper" - "Macros" - "The name of your macro" - Parameters tab ?

  • Ivan 139 posts 302 karma points
    Jun 26, 2010 @ 12:49
    Ivan
    0

    Thanks a lot guys!! My code was ok. Reinstalling Umbraco fixed the problem.

Please Sign in or register to post replies

Write your reply to:

Draft