Copied to clipboard

Flag this post as spam?

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


  • Darryl Godden 145 posts 197 karma points
    Mar 18, 2010 @ 11:39
    Darryl Godden
    0

    xsl:if not displaying correctly

    I have the following bits of XSL in my lengthier MeetingsFeed.xslt, the idea of this bit of code is to display an upload link if the meeting content has no document in it's file upload:

    <xsl:if test="data [@alias = 'meetingAgenda'] = ''">
                <xsl:variable name="meetingNodeID" select="@id" />
                <div id="agendaLink" class="agendaLink">
                    <a id="addAgendaLink" href="{$meetingNodeID}">Add Agenda</a>
                </div>
            </xsl:if>
    
            <xsl:if test="data [@alias = 'meetingMinutes'] = ''">
                <xsl:variable name="meetingNodeID" select="@id" />
                <div id="minutesLink" class="minutesLink">
                    <a id="addMinutesLink" href="{$meetingNodeID}">Add Minutes</a>
                </div>
    </xsl:if>

    The problem I'm having is that in the two meetings that are stored, neither have documents stored against them, yet the XSL only displays one link on the last meeting item.

    Is there something wrong with the code?

    Regards,

     

    Darryl

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Mar 18, 2010 @ 11:54
    Douglas Robar
    0

    Very strange! If it works for one it should work for all. I can think of two moderately unlikely things to check into.

    1. Wrap a string() around your two IF tests... <xsl:if test="string(data[@alias='meetingAgenda']) = '' ">

    2. Confirm that the loop these if tests are in is actually cycling through the items properly. Perhaps include the following above the first IF statement temporarily:

    <xsl:value-of select="@nodeName" />

    cheers,
    doug.

  • Darryl Godden 145 posts 197 karma points
    Mar 18, 2010 @ 14:43
    Darryl Godden
    0

    Look like it is fine, I think the test is wrong against a 'Uploader' property, thanks anyway Doug.

Please Sign in or register to post replies

Write your reply to:

Draft