Copied to clipboard

Flag this post as spam?

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


  • selvakumar.kasinathan@defiance-tech.com 4 posts 24 karma points
    May 21, 2012 @ 12:15
    selvakumar.kasinathan@defiance-tech.com
    0

    error in assigning value to variable base on condion.

    Hi,

     

    This way of variable declaration is working fine:

     <xsl:variable name="Brandsqlresult"  select="jesper.sql:SQLXml($GetBrandPagewise)"/>

    Here variable GetBrandPagewise variable get parsed and return a  assign that value to Brandsqlresult.

    and second way assigning values based on condition:

       <xsl:variable name="Brandsqlresult">
              <xsl:choose>
                <xsl:when test="$SqlSession=''">
                  <xsl:value-of  select="jesper.sql:SQLXml($GetBrandPagewise)"/>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:value-of select="jesper.sql:SQLXml($SqlSession)"/>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:variable>

    but here, Brandsqlresult is assigned with empty when i checking for When condition is true.

    I have no idea where i am commiting a mistake.

     

  • Lee Kelleher 4026 posts 15837 karma points MVP 13x admin c-trib
    May 21, 2012 @ 13:28
    Lee Kelleher
    0

    Hi Selvakumar, welcome to Umbraco.

    Try changing the <xsl:value-of> tags to <xsl:copy-of> ... as "value-of" tries to give you the text value (e.g. the inner-text) of the XML nodes, whereas the "copy-of" will give you a copy of the XML itself.

    Cheers, Lee.

  • selvakumar.kasinathan@defiance-tech.com 4 posts 24 karma points
    May 21, 2012 @ 14:34
    selvakumar.kasinathan@defiance-tech.com
    0

    Thank you so much....,

    Its working as expected....

  • 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