Answered xsl extract data using substring-before and substring-after

  • Monday, July 02, 2012 6:34 AM
     
     

    Hi experts, what is the most effective way to extract data using substring-before and substring-after?

    Suppose I have ">data here<", using the two substring function I should get the result "data here".

    Appreciate the ideas.


    Cheers, R2C3 ----------------------------------- starting sharepoint :)

All Replies

  • Monday, July 02, 2012 9:44 AM
    Moderator
     
     Answered

    Hi R2C3,

    Based on your description, I test on my local server, you can use nested substring-before and substring-after to achieve your problem. Below is a sample to get the string after ‘n’ and before ‘l’ of the column Title:

    <xsl:value-of select="substring-before(substring-after(@Title, 'n'),'l')"/>

    Best Regards.


  • Monday, July 02, 2012 1:10 PM
     
     
    Hello Yaoyao,  thanks I thought that is possible. 

    Cheers, R2C3 ----------------------------------- starting sharepoint :)