XSLT transforming BR tag into <br></br>

Here should go questions about transforming XML with XSLT and FOP.
sderrick
Posts: 269
Joined: Sat Jul 10, 2010 4:03 pm

XSLT transforming BR tag into <br></br>

Post by sderrick »

In my xsl script I specify the output in a certain template as
<br/>

My output must be well formed xhtml, I've tried xhtml and xml as the output method

both output <br></br> which most browsers interpret as two break tags.

Can I get the saxon PE parser to emit <br/> instead of <br></br> ?

I can't use html as the output method, besaue it emits malformed xhtml.
here is my current <output.... element

Code: Select all


   <xsl:output name="csps-xhtml" method="xhtml"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
indent="no"
encoding="us-ascii"
saxon:character-representation="entity:hex"/>
thanks,

Scott
sderrick
Posts: 269
Joined: Sat Jul 10, 2010 4:03 pm

Re: XSLT transforming BR tag into <br></br>

Post by sderrick »

SOLVED!!!

Code: Select all


 <xsl:value-of disable-output-escaping="yes"><br/></xsl:value-of>
ouputs <br/> into the xhtml !!

woohoo!
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: XSLT transforming BR tag into <br></br>

Post by adrian »

Hello,

If you want even better browser compatibility you should use:
<br /> (space before slash)

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
sderrick
Posts: 269
Joined: Sat Jul 10, 2010 4:03 pm

Re: XSLT transforming BR tag into <br></br>

Post by sderrick »

Thanks Adrian,

and wilco

Scott
Post Reply