Copied to clipboard

Flag this post as spam?

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


  • Brian Juul Andersen 44 posts 98 karma points c-trib
    Oct 19, 2010 @ 10:02
    Brian Juul Andersen
    0

    Similar XSLT scripts render differently ?

    I got the following two similiar XSLT scripts for getting a picture each with the GetMedia method but they render quite differently.

    Script 1 gives me: <img alt="" src="/media/125/mini_spr1.gif" id="mini1"> which is fine for now.

    Script 2 gives me: <img alt="" src="" id="mini2"> - src is missing ???

     

    I´ve checked up on the linking between the XSLT´s and the macroes I use in the template - they are fine. I´ve also checked up on if the correct aliases are being used - also fine.

    Has anyone got an idea why this is happening ?

     

    Script 1

     

    <?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 match="/">

    <!-- start writing XSLT -->
        <xsl:variable name="mini1" select="umbraco.library:GetMedia($currentPage/miniPic1, 0)" />
        <img id="mini1" src="{$mini1/umbracoFile}" alt="{$mini1/altText}" />
    </xsl:template>

    </xsl:stylesheet>

     

    Script 2

     

    <?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 match="/">

    <!-- start writing XSLT -->
        <xsl:variable name="mini2" select="umbraco.library:GetMedia($currentPage/miniPic2, 0)" />
        <img id="mini2" src="{$mini2/umbracoFile}" alt="{$mini2/altText}" />
    </xsl:template>

    </xsl:stylesheet>
  • Brian Juul Andersen 44 posts 98 karma points c-trib
    Oct 19, 2010 @ 10:07
    Brian Juul Andersen
    0

    I got it solved...

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies