Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.