SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using this function to render items in a multi-select lookup field so that each one appears on a new line instead of AA;BB;CC;DD etc. This method uses the substring-before and substring-after functions on a loop to extract the semicolon-delimited values.

The trouble comes when there is an ampersand or other encoded character in the returned values. For example AA;B&C;DD is parsed as AA;B& amp;C;DD so the final result is

AA B&amp C

Is there a better way to extract the delimited values, telling xslt to separate on ';' but ignore '& amp;' ?

(I added the space in & amp; because the parser was outputting ampersands!!)

share|improve this question

I believe you just need to add disable-output-escaping="yes" to your xsl:value-of statement you display the & as a &.

share|improve this answer
Hey PirateEric, thanks for the reply. That was the first thing I tried, however I found that the rendering of the xsl:value-of occurs after the substring-before and substring-after functions are called on the original, encoded string. – hiphopanonymous Dec 7 '11 at 22:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.