Copied to clipboard

Flag this post as spam?

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


  • Lee 1130 posts 3088 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 10092 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 1130 posts 3088 karma points
    Dec 04, 2009 @ 13:19
    Lee
    0

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

Please Sign in or register to post replies

Write your reply to:

Draft