ChrisEvans wrote:
> I've got an XML file which uses an XSL stylesheet. Problem is:
>
> <br />
>
> tags don't work for me when the content is gathered from the xml.
> Example:
>
> <main>
> <title>Hi</title>
> <content>Hello, how are you?<br /><br />I'm fine.</content>
> </main>
>
> Then in the stylesheet its positioned in the correct place etc and
> using <xsl:value-of select="content" /> - trouble is the <br /> doesn't
> do anything.
<xsl:value-of select="content" /> outputs the string value of the
element <content>, if the element has empty child elements like <br />
then these indeed do not in any way show up with value-of.
What you probably want is recursive processing of child nodes of
<content> e.g.
<xsl:template match="content">
<div>
<xsl:apply-templates />
</div>
</xsl:template>
and then a template that copies <br> elements from the input XML to the
XSLT output
<xsl:template match="br">
<xsl:copy />
</xsl:template>
--
Martin Honnen
http://JavaScript.FAQTs.com/