Copied to clipboard

Flag this post as spam?

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


  • Przemo 2 posts 22 karma points
    Dec 09, 2009 @ 18:17
    Przemo
    0

    call-template problem

    Hi all,
    I have 2 macros xslt one of which causes the other.
    Sample test.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:include href="../xslt/test2.xslt" />
    <xsl:output method="xml" omit-xml-declaration="yes"/>
    <xsl:template match="/">
      test2 content:[ <xsl:call-template name="testFunction" />]
    </xsl:template>
    </xsl:stylesheet> 

    Sample test2.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:template name="testFunction">
      aaa
    </xsl:template>
    </xsl:stylesheet>

    When I change the contents of test2.xslt  eg:

    <xsl:template name="testFunction">
      bbb
    </xsl:template>

    and save it. Changes are not visible on website, untill i again save test.xslt file.
    Did I do something wrong?

    Thanks in advance!
    Przemo

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Dec 09, 2009 @ 18:27
    Dirk De Grave
    0

    Nope, nothing wrong, you need to touch the 'master' for each change in the 'child'. I've seen some posts from people who're trying to tackle this issue, not sure if they managed to do so... Can't find it at the moment. It should be in the Developers/Xslt category tho.

     

    Cheers,

    /Dirk

     

     

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Dec 09, 2009 @ 18:27
    Peter Dijksterhuis
    0

    I believe this is standard behaviour of xslt when you use includes.

    If you modify a file, you need to save the ones that include that one as well.

    HTH,

    Peter

  • toth3max 2 posts 22 karma points
    Dec 09, 2009 @ 18:30
    toth3max
    0

    Hello.

    I'm not sure about this but if umbraco caches all XSLT:s then it could have "baked" the test.xslt and merged test2.xslt inside test.xslt.

    What would you like to accomplish with having a second linked xslt file?

Please Sign in or register to post replies

Write your reply to:

Draft