Hello all,
I have a problem with my XML that I am trying to display on my ASP.NET page that I could do with some help with. What I would like to do is display it on a multi-line so I have an XML file that looks like this:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="News.xslt" ?>
<newslist>
<news>
<date>20th June 2010</date>
<detail>Detail line 1.
Detail Line 2</detail>
</news>
<news>
<date>18th June 2010</date>
<detail>Some more details</detail>
</news>
</newslist>
And I have an XSLT file that looks like this:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:template match="/">
<HTML>
<BODY>
<xsl:for-each select="newslist/news">
<xsl:sort select="date" order="descending"/>
<br />
<h3><xsl:value-of select="date" /></h3>
<ul>
<p><xsl:value-of select="detail" /></p>
</ul>
</xsl:for-each>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
When it displays the first detail line everything is on the same line. I've done some digging about and I have tried the following:
- xml:space="preserve" in the XSLT file
- in the XML file
<br />
- I've even tried leaving it as it is.
I am using Microsoft Visual Web Developer 2010. The control I am using is the XML control under the standard tab, and the language I am using is C#, if that helps any.
If this has already been answered and I haven't found it yet can you please point me at it.
Thanks for your help.