Page 1 of 1

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

Posted: Sat Apr 30, 2011 5:42 am
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

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

Posted: Sat Apr 30, 2011 6:02 am
by sderrick
SOLVED!!!

Code: Select all


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

woohoo!

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

Posted: Mon May 02, 2011 12:55 pm
by adrian
Hello,

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

Regards,
Adrian

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

Posted: Mon May 02, 2011 4:07 pm
by sderrick
Thanks Adrian,

and wilco

Scott