XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old June 30th, 2003, 05:05 AM
adcworks2 adcworks2 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 5 adcworks2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cannot get new line into XSL output

Hi All,

I am using XSL to convert XML into a CSV file. I have set

<xslutput 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

Reply With Quote
  #2  
Old July 22nd, 2003, 03:25 PM
sanchezal sanchezal is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 2 sanchezal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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?

Reply With Quote
  #3  
Old July 22nd, 2003, 04:54 PM
mrusaw's Avatar
mrusaw mrusaw is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Dallas, Texas
Posts: 138 mrusaw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to mrusaw Send a message via Yahoo to mrusaw
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.

Reply With Quote
  #4  
Old July 22nd, 2003, 05:18 PM
sanchezal sanchezal is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 2 sanchezal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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...

Reply With Quote
  #5  
Old July 22nd, 2003, 05:33 PM
mrusaw's Avatar
mrusaw mrusaw is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Dallas, Texas
Posts: 138 mrusaw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to mrusaw Send a message via Yahoo to mrusaw
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...

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Cannot get new line into XSL output


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway