I have som XML that link to an XSL-file to enable on-the-fly
HTML-generation by e.g. IE or FireFox. The transformation actually works
like a charm, but I have problems with changing line breaks in the XML to
their html-equivilant <br/>.
I use the XSL:
<xsl:template name="break">
<xsl:param name="text" select="."/>
<xsl:choose>
<xsl:when test="contains( $text, '
')">
<xsl:value-of select="substri ng-before($text, '
')"/>
<br/>
<xsl:call-template name="break">
<xsl:with-param name="text" select="substri ng-after($text,'&# xa;')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwis e>
<xsl:value-of select="$text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
And I apply it to the specific XML-element with the code
<xsl:call-template name="break">
<xsl:with-param name="text" select="descrip tion"/>
</xsl:call-template>
When I display the XML-file in IE, it all looks fine and dandy - but when I
load the page in FireFox (1.0 PR), the linebreaks are not converted to
html-<br>-tags.
What am I doing wrong?
And - are there some programs out there that will allow me to supply a
XML-file and a XSL-stylesheet - and then display the result of the
XSL(T)-transaformation ?
--
Jesper Stocholm
http://stocholm.dk
"Man knepper ikke en anden ridders mø"