Subject: Re: [xsl] Translating the new lines to line breaks with HTML transformation From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Fri, 09 Dec 2011 10:51:02 -0500 |
I am using XSLT 1.0 and using is not an option at this time.
I have XML data as below and I need to transform to HTML. I want to insert line breaks for the DATES field for the new lines while transforming. I tried to use translate but it only replaces one character with another character.
I am very new to XSL, any suggestion would be great..
T:\ftemp>type soyer.xml <?xml version="1.0"?> <ROWSET> <ROW> <SEASON_CODE>HIGH</SEASON_CODE> <SEASON_DESC>High Season</SEASON_DESC> <DATES>Thu 2005-09-01 - Wed 2005-11-30 Fri 2006-09-01 - Sun 2006-12-03 Tue 2011-11-01 - Sat 2011-12-17</DATES> </ROW> </ROWSET>
<xsl:template name="split-text"> <xsl:param name="text"/> <xsl:choose> <xsl:when test="contains($text,'
')"> <xsl:value-of select="substring-before($text,'
')"/> <br/> <xsl:call-template name="split-text"> <xsl:with-param name="text" select="substring-after($text,'
')"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$text"/> </xsl:otherwise> </xsl:choose> </xsl:template>
</xsl:stylesheet> T:\ftemp>
-- Contact us for world-wide XML consulting and instructor-led training Free 5-hour video lecture: XSLT/XPath 1.0 & 2.0 http://ude.my/t37DVX Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Google+ profile: https://plus.google.com/116832879756988317389/about Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Translating the new lines to , Soyer, Muhammed A. | Thread | RE: [xsl] Translating the new lines, Soyer, Muhammed A. |
Re: [xsl] xslt transformation did n, Boudewijn Bosgoed | Date | RE: [xsl] Translating the new lines, Soyer, Muhammed A. |
Month |