This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Formatting text to include html tags...?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]