View Full Version : XSLT-extractable line break?[FIXED]
darkmage784
09-21-2005, 08:48 PM
Is there any way to insert a line break into my XML that will be put into the XHTML returned by a stylesheet? A <br /> tag gets hidden, escaping a line feed and carriage return does nothing and escaping the <br /> tag puts the actual text in (ex: this text should<br />be broken). Anyone know a way to do this(and/or other formatting data)?
KC-Luck
09-22-2005, 03:53 PM
<xsl:text>& # 1 3;</xsl:text>
or setup like this
<xsl:variable name="n" select="'& # 1 3;'"/> (just below xsl:stylesheet tag)
<xsl:value-of select="$n"/> (where newline needed.)
note: remove the extra spaces in : & # 1 3;
darkmage784
09-22-2005, 08:49 PM
I meant insert an instruction in my XML data sheet to make my XSLT stylesheet's <xsl:value-of> write a line break to the output.
KC-Luck
09-22-2005, 09:14 PM
you can create any such tag, and then appropriately match it in your xslt.
<some_xml>
.........<br/>
.........<br/>
</some_xml>
<xsl:template match="some_xml">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="br">
<xsl:text>& #13;</xsl:text>
</xsl:template>
<xsl:template match="text()">
<xsl:value-of select="."/>
</xsl:template>
darkmage784
09-23-2005, 12:27 AM
Thank you!!!!!!!!!
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.