Subject: [xsl] Controlling Whitespace in IE From: "Spencer Tickner" <spencertickner@xxxxxxxxx> Date: Thu, 4 May 2006 09:55:17 -0800 |
I'm having an issue with ie's translation of my xml document. With this document:
<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="test.xsl"?> <root> <sentencetext>blah <def>blah blah</def> blah blah <def>foo</def> <def>bar</def>.</sentencetext> </root>
the foo and the bar are stuck together. I am using this stylesheet to try and force them apart:
<?xml version='1.0'?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output media-type="html"/>
<xsl:variable name="cr"><xsl:text> </xsl:text></xsl:variable>
<xsl:template match="/"> <html> <body> <xsl:apply-templates/> </body> </html> </xsl:template>
<xsl:template match="sentencetext"> <p><xsl:apply-templates/></p><xsl:value-of select="$cr"/> </xsl:template>
<xsl:template match="def"> <a class="definition" href="something"><em><xsl:apply-templates/></em></a> </xsl:template>
<xsl:template match="text()"> <xsl:choose> <xsl:when test="normalize-space(.) = ''"><xsl:text> </xsl:text></xsl:when> <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise> </xsl:choose> </xsl:template>
For instance, when I put a 1 before the <xsl:text> </xsl:text> in firefox I get 1's exactly where I would expect them and foo and bar are seperated by a space. However in IE, no 1's appear. Does anybody know of a hack or work around for this.
Spencer Victoria BC, Canada
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XSL-FO: Exclude page numb, Nadia . Swaby | Thread | RE: [xsl] Controlling Whitespace in, Michael Kay |
Re: [xsl] XSL-FO: Exclude page numb, Nadia . Swaby | Date | RE: [xsl] Controlling Whitespace in, Michael Kay |
Month |