How to Remove HTML tags in XSLT

Today I was working on DFWP, I came across a requirement in which I have to get the value of a user-type column of my custom list. A simple “<xsl:value-of ” was not working for me since SharePoint actually stores user type value as HTML fragment, not just as a value.

For example, if the value stored in a user type column is MYSERVER\USER1 then SharePoint stores a string <nobr><span><A HREF=”/DesignerSite/_layouts/userdisp.aspx?ID=8″>MYSERVER\user1</A><img border=”0″ height=”1″ width=”3″ src=”/_layouts/images/blank.gif”/><img border=’0′ height=’12′ width=’12′ src=’/_layouts/images/blank.gif’ alt=”></span></nobr>


Now for using this value within my DFWP (say, store it in a variable for making some conditional branching), I have to remove the HTML tags that surrounds the actual value. Googling around for a XSLT function took me here, one of favorite blog!

0 comments:

Post a Comment

Popular Posts