[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Line feeds to breaks

Subject: Line feeds to breaks
From: Aaron Johnson <Aaron2.Johnson@xxxxxxxxx>
Date: Wed, 19 Jan 2005 10:49:33 +0000
xml line feeds
HiB


 

Appologies if you have already received this ...our email system is playing
silly buggers...



I'm having a problem with converting line feeds to html breaks.



Microsoft value is &#10;




Java /Unix value is &#13;





When the page is transformed, the line breaks are huge depending on
which
value is used and what platform you display the page on.





Is there a way to get around this?



Any help would be most appreciated thank you.




AMJ





    

<!--

  
Template: lf2br

  
Converts XML linefeeds to html <br />


NB: if linebreaks seem strange, stylus studio has


helpfully reformatted the xml for you. You need to


check that transforms read ($StringToTransform,'&#10;')


 
Inputs:

    
StringToTransform



Output:

    
String with LF's converted to <br />


-->

     

<xsl:template name="lf2br">


<xsl:param name="StringToTransform"/>


<xsl:choose>

     
<xsl:when test="contains($StringToTransform,'&#13;')">



<!--

        
<xsl:value-of select="substring-before($StringToTransform,'&#10;')"/>


-->

              

<xsl:call-template name="convertcase">


<xsl:with-param 
name="toconvert"
select="substring-before($StringToTransform,'&#13;')"/>


<xsl:with-param name="conversion" select="'proper'"/>


</xsl:call-template>


<br/>

            
<xsl:call-template name="lf2br">


<xsl:with-param name="StringToTransform">


<xsl:value-of
select="substring-after($StringToTransform,'&#13;')"/>


</xsl:with-param>


</xsl:call-template>


</xsl:when>

      
<xsl:otherwise>

  

<!--

        
<xsl:value-of select="$StringToTransform"/>


-->

              

<xsl:call-template name="convertcase">


<xsl:with-param name="toconvert"
select="$StringToTransform"/>


<xsl:with-param name="conversion" select="'proper'"/>


</xsl:call-template>


</xsl:otherwise>

 
</xsl:choose>

    
</xsl:template>


......................................................................

Aaron Johnson
GUI / XSLT development
Academic Technologies Group [ATG]
University of the West of England

ext: 81051
t: 0117 3281051 
www: http://atg.uwe.ac.uk/aaron
e: aaron2.johnson@xxxxxxxxx
......................................................................

......................................................................

SECURITY POLICY:

Please note that ATG will only accept
e-mail attachments in the following
formats:

.doc,.gif,.jpg,.mdb,.png,.xls,.zip,.psd
.html,.shtml,.xml,.xsl,.sdf,.asp

...as a mac user I will accept files
compressed using Dropstuff.
......................................................................

This communication is intended solely
for the use of the individual(s) to whom
it is addressed. Any opinions presented
are those of the author and do not
necessarily represent the University of
the West of England, Bristol.
......................................................................




This email has been independently scanned for viruses and any virus software has been removed using McAfee anti-virus software

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.