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

RE: break line using stylesheet

Subject: RE: break line using stylesheet
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 21 Oct 2005 15:09:28 +0100
break line
To output <br> in your HTML, just write <br/> in your stylesheet. It's as
easy as that.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Vincent Lapointe [mailto:lapointe_vincent_1975@xxxxxxxxxxx] 
> Sent: 21 October 2005 14:21
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  break line using stylesheet
> 
> Hi all,
> I'm pretty new to xml/xsl/html files and have the following 
> problem: I'm 
> using xml and xsl to generate a simple html file. In the 
> generated html 
> document, I want to output some break lines but mozilla 
> firefox doesn't show 
> the same output as internet explorer. In internet explorer 
> the break lines 
> appear as html break lines, but in mozilla the break lines appear as 
> litteral string "<br>".
> 
> See below for my xml and xsl files. I also put the desired 
> output and the 
> mozilla output.
> 
> I tryed to following modifications in my xsl and xml files:
> - I replaced the litteral "&lt;br&gt;" by the litteral "<br>" 
> in my xml 
> file, and it didn't work...
> - I replaced the litteral "&lt;br&gt;" by real \n character 
> in my xml file, 
> and it didn't work...
> - I replaced the litteral "&lt;br&gt" by the litteral 
> "l&#x0d;&#x0a", and it 
> didn't work...
> - I setted the disable-output-escaping attribute to "yes" and 
> "no", and it 
> didn't work with above combination...
> - I added the <xsl:preserve-space elements="text"/> in my xsl 
> file and it 
> didn't work with above combination...
> 
> I'm using internet explorer 6.0 and mozilla firefox 5.0 
> (win32 and redhat).
> 
> Why I wasn't able to see a break line in mozilla?
> 
> Any idea? Thanks for your comments...
> 
> Regards,
> Vincent
> 
> -------------------
> test1.xml
> -------------------
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <?xml-stylesheet type="text/xsl" href="test1.xsl"?>
> <root>
> <text>test1&lt;br&gt;test2&lt;br&gt;test3&lt;br&gt;</text>
> <text>test4</text>
> <text>test5&lt;br&gt;test6&lt;br&gt;</text>
> <text>test7</text>
> </root>
> -------------------
> test1.xsl
> -------------------
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method="html" indent="yes" encoding="iso-8859-1"/>
> <xsl:template match="root">
> <html>
> <body>
> <xsl:apply-templates select="text"/>
> </body>
> </html>
> </xsl:template>
> <xsl:template match="text">
> <div>
> <xsl:value-of select="." disable-output-escaping="yes"/>
> </div>
> </xsl:template>
> </xsl:stylesheet>
> -------------------
> Desired html output (as in internet explorer)
> -------------------
> test1
> test2
> test3
> test4
> test5
> test6
> test7
> -------------------
> Mozilla html output
> -------------------
> test1<br>test2<br>test3<br>
> test4
> test5<br>test6<br>
> test7 

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.