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 am working with SharePoint library and DataView webpart. I have a SharePoint list in which one of the column is a multi-line text. I have inserted a DataView webpart in the designer using the list. In code behind I am acessing the Columns of the list and generating the xml string out of it. But when I access the column with multi-line text the xslt causes line breaks in xaml string which I dont want. Can any one tell me how can I get rid of the line breaks? Below is the xslt. *Description * is the column with multi-line

<xsl:for-each select="/dsQueryResponse/Rows/Row">

<xsl:text disable-output-escaping="yes"><![CDATA[+ ' <BOOK Description ="]]></xsl:text>

<xsl:value-of select="./@Description " />
       <xsl:text disable-output-escaping="yes"><![CDATA[" PRICE="]]></xsl:text>
<xsl:value-of select="@price" />

<xsl:text disable-output-escaping="yes"><![CDATA["/>']]></xsl:text>


Xml generated:

+ ' <BOOK Description ="sdfdfdfdgfgfg
sharmila" PRICE="45"/>'
+ ' </BOOK>' 

The above xml generated has unwanted line-breaks I need the xml to be generated as below.

+ ' <BOOK Description ="sdfdfdfdgfgfgfgfgfgfgfgfgsharmila" PRICE="45"/>'
+ ' </BOOK>'  

Thanks and Regards, Sharmila

share|improve this question

Please, try to replace your <xsl:value-of select="./@Description " /> with the following code:

<xsl:value-of select="translate(./@Description,'&#xA;','')"/>

This should remove all line breaks from the Description column.

share|improve this answer
Thanks:) but it is not working for me. I have tried using <xsl:value-of select="translate(./@Description,'&lt;br&gt;','\\n')"/> – sharmila Feb 7 '12 at 9:34
but why are you replacing to '\\n'? replace to empty string ''. – Andrey Markeev Feb 8 '12 at 18:34

Please go through the below post .I hope this would help you

share|improve this answer
Thanks :) But where can I find the itemstyle.xsl ?? I am using WSS 3.0 – sharmila Feb 7 '12 at 6:48

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.