G
Guest
I have noticed a difference in the processing of XSL transforms between
dotnet and MSXML. Dotnet formats the resulting output differently, and since
we use the <pre> tag in the HTML output it makes a big difference.
What is in fact correct here? I don't see that the XSL transform engine
should reformat the output in this way, and would like to know if this
difference is going to remain in future.
The transform in question can be split down into the following:
XML:
<?xml version="1.0" encoding="Windows-1252"?>
<?xml-stylesheet type="text/xsl" href="./test1.xsl"?>
<outer xml:space="preserve">
<inner> Text 1 </inner>
<inner> Text 2 </inner>
</outer>
XSL:
<?xml version="1.0" encoding="windows-1252"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xslutput method="html"/>
<xsl:template match="outer">
<html>
<pre>
<xsl:apply-templates select="inner"/>
</pre>
</html>
</xsl:template>
<xsl:template match="inner">
<font color="#ff0000"><xsl:value-of select='.'/></font><nobr/>
</xsl:template>
</xsl:stylesheet>
The HTML resulting from this from MSXML is:
<html>
<pre>
<font color="#ff0000"> Text 1 </font><nobr></nobr><font color="#ff0000">
Text 2 </font><nobr></nobr></pre>
</html>
and from dotnet:
<html>
<pre>
<font color="#ff0000"> Text 1 </font>
<nobr>
</nobr>
<font color="#ff0000"> Text 2 </font>
<nobr>
</nobr>
</pre>
</html>
and obviously these look quite different in a browser.
Thanks for any suggestions,
Peter
dotnet and MSXML. Dotnet formats the resulting output differently, and since
we use the <pre> tag in the HTML output it makes a big difference.
What is in fact correct here? I don't see that the XSL transform engine
should reformat the output in this way, and would like to know if this
difference is going to remain in future.
The transform in question can be split down into the following:
XML:
<?xml version="1.0" encoding="Windows-1252"?>
<?xml-stylesheet type="text/xsl" href="./test1.xsl"?>
<outer xml:space="preserve">
<inner> Text 1 </inner>
<inner> Text 2 </inner>
</outer>
XSL:
<?xml version="1.0" encoding="windows-1252"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xslutput method="html"/>
<xsl:template match="outer">
<html>
<pre>
<xsl:apply-templates select="inner"/>
</pre>
</html>
</xsl:template>
<xsl:template match="inner">
<font color="#ff0000"><xsl:value-of select='.'/></font><nobr/>
</xsl:template>
</xsl:stylesheet>
The HTML resulting from this from MSXML is:
<html>
<pre>
<font color="#ff0000"> Text 1 </font><nobr></nobr><font color="#ff0000">
Text 2 </font><nobr></nobr></pre>
</html>
and from dotnet:
<html>
<pre>
<font color="#ff0000"> Text 1 </font>
<nobr>
</nobr>
<font color="#ff0000"> Text 2 </font>
<nobr>
</nobr>
</pre>
</html>
and obviously these look quite different in a browser.
Thanks for any suggestions,
Peter