This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Formatting text to include html tags...?
- To: "Ragulf Pickaxe" <jawxml at hotmail dot com>
- Subject: Re: [xsl] Formatting text to include html tags...?
- From: Jeni Tennison <jeni at jenitennison dot com>
- Date: Mon, 5 Nov 2001 10:18:39 +0000
- CC: xsl-list at lists dot mulberrytech dot com
- Organization: Jeni Tennison Consulting Ltd
- References: <F7919bEjG4dvI6xc72B00004163@hotmail.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Ragulf,
> Is there a way that I can do this? The solution should also enable
> newline (<br/>) tags, if possible.
It looks as though you want to use xsl:copy-of (which makes a deep
copy of whatever nodes you select, including elements) rather than
xsl:value-of (which gives the string value of a node, and doesn't
retain any structure). Try:
<xsl:template match="/">
<html>
<body>
<xsl:copy-of select="Test/node()" />
</body>
</html>
</xsl:template>
You need Test/node() rather than just Test because if you copied the
Test element, you'd get the Test element itself as well as its
descendants. With Test/node() you get a copy of the content of the
Test element without the Test element itself.
I hope that helps,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list