Copied to clipboard

Flag this post as spam?

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


  • Kasper Dyrvig 246 posts 379 karma points
    Aug 25, 2010 @ 14:38
    Kasper Dyrvig
    0

    How to get rid of whitespace

    This is not an urgent matter, but I would like to know how to get rid of whitespaces?

    Fx:

    <div>
        <xsl:attribute name="style">
          <xsl:if test="$currentPage/bodyColor != ''">
          background: <xsl:value-of select="$currentPage/bodyColor"/>;
          </xsl:if>
        </xsl:attribute>
        &nbsp;
      </div>

    Outputs: (notice &#zA;)

    <div style="&#xA;        background: red;&#xA;      ">
     
    </div>
  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Aug 25, 2010 @ 14:55
    Ismail Mayat
    1

    try wrapping background with <xsl:text></xsl:text>

    Regards

    Ismail

  • Kasper Dyrvig 246 posts 379 karma points
    Aug 25, 2010 @ 15:06
    Kasper Dyrvig
    0

    Well that acurlly did the trick for this situation.

    Cool. Thanks

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Aug 25, 2010 @ 15:33
    Lee Kelleher
    0

    I use the same method as Ismail said.

    An alternative would be to use the concat() function, e.g.

    <xsl:value-of select="concat('background: ', $currentPage/bodyColor, ';')"/>

    Cheers, Lee.

Please Sign in or register to post replies

Write your reply to:

Draft