Why does transforming xml into html remove <br/> tags?
For example a test xml document:
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="archwayEmail.xslt"?>
<archway issueId="35" title="Archway Update For Thursday, July 21, 2005" dateCompiled="7/21/2005 11:02:09 AM">
<news id="154">
<title>Test Title 1</title>
<shortText>Some short text<br/>More short text</shortText>
</news>
<news id="155">
<title>Test Title 2</title>
<shortText>Some short text</shortText>
</news>
</archway>
And the template:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="UTF-8" standalone="yes" version="4.0" indent="yes" media-type="text/html" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" doctype-system="http://www.w3.org/TR/html4/loose.dtd" />
<!-- MAIN TEMPLATE -->
<xsl:template match="/">
<html>
<body>
<xsl:apply-templates select="//archway" />
<p>News</p>
<xsl:apply-templates select="//archway/news" />
</body>
</html>
</xsl:template>
<!-- ARCHWAY TEMPLATE -->
<xsl:template match="archway">
<p class="header"><xsl:value-of select="@title" /></p>
</xsl:template>
<!-- NEWS TEMPATE -->
<xsl:template match="news">
<p><xsl:value-of select="title" /></p>
<p><xsl:value-of select="shortText" /></p>
</xsl:template>
</xsl:stylesheet>
When the template is applied to the xml, the resulting html is fine with the exception that the <br/> tag in the shortText node of the first news node gets removed.
I am using ASP with the MSxml2.DOMDocument.3.0 processor.
Thanks for your help.
Joe