Copied to clipboard

Flag this post as spam?

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


  • Lee 1123 posts 3059 karma points
    Dec 04, 2009 @ 12:41
    Lee
    0

    String Manipulation In XSLT?

    I am getting a bit unstuck with trying to manipulate a string based on values from properties in a macro.  For example I have a string

    this is a string i would like to replace words in

    And I would like to replace a number of words based on values the user puts into properties in the macro

    <xsl:variable name="searchTerm" select="/macro/searchterm" />

    Now say I wanted to replace one of the words in that string - How would I go about doing it?  Or should I just be using ASP.NET now I can getting into string manipulation etc...

    Thanks in advance =)

     

  • Ismail Mayat 4511 posts 10059 karma points MVP 2x admin c-trib
    Dec 04, 2009 @ 12:46
    Ismail Mayat
    0

    Lee,

    Use the umbraco extension library method

    <xsl:variable name="searchTerm" select="umbraco.library:Replace(/macro/searchterm, 'words', 'test')" />

  • Lee 1123 posts 3059 karma points
    Dec 04, 2009 @ 13:19
    Lee
    0

    Top Man - Thanks... I think I need to learn the umbraco.library a bit better ;)

  • 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