|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Cannot get new line into XSL output
Hi All,
I am using XSL to convert XML into a CSV file. I have set <xsl utput version="1.0" indent="no" method="text" omit-xml-declaration="yes" />And everything is working but no carriage returns or linefeeds are coming out. That is, all my rows are just one long bit of text. I am using <xsl:text> </xsl:text> to get the return characters (like \r\n) but this is just not working. I tried testing whether MSXML4 can do this tag and it can, and using a different code for like , does output the required comma. Can anyone suggest why I cannot get the carriage return/line feed thing working? Thanks |
|
#2
|
|||
|
|||
|
Re: Cannot get new line into XSL output
I have the same problem
I replaced all the carriage return and linefeed for the string "<br>" directly in the XML, but it didn't work. Also I used disable-output-escaping="yes" in the XSL, nothing yet... Does anyone know how to solve this? |
|
#3
|
||||
|
||||
|
If you are using MSXML you'll probably have to to put an actual CR or FL character:
Code:
<xsl:text> </xsl:text> *the actual character reference will not show up in this posting after i save because the browser is actually translating it so use the following without the spaces between: & # 10 ; Last edited by mrusaw : July 22nd, 2003 at 05:00 PM. |
|
#4
|
|||
|
|||
|
Did not work...
This is my data:
<NOTICIA attrib1="something" attrib2="something else" attrib3="this is the first line this is a new line"/> What I did in the source code (VB.NET) was to replace every vbCrLf with "& # 10 ;" /*without the blanks*/ This is my XSL: <font STYLE="font-family:Verdana;font-size:8pt;text-align=left;color= #000000"> <xsl:value-of select="@attrib3" disable-output-escaping="yes"/> </font> If I use <xsl:text> ... </xsl:text> it crashes. I also tried to use "& # 13 ;" but didn't work Before, I tried "<br>" , "& lt ; br & gt ;". But the result was: "This is the first line <br> this is a new line" I don't know what to do... |
|
#5
|
||||
|
||||
|
i am not sure if this get's you there but try this:
Code:
<xsl:template match="NOTICIA" attr1="blah" attr2="blah"> <xsl:value-of select="attr3_now_childA"/> <xsl:text><xsl:value-of select="attr3_2nd_line_now_cildB"/><xsl:text> <xsl:text><xsl:value-of select="attr3_3rd_line_now_cildC_etc..."/><xsl:text> </xsl:template> *note you'll have to change you xml to refelct the element changes... |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > Cannot get new line into XSL output |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|