Re: [xsl] Formatting text to include html tags...?

Subject: Re: [xsl] Formatting text to include html tags...?
From: ronald heller <ronald@xxxxxxxxxxx>
Date: Mon, 05 Nov 2001 11:06:10 +0100
Using common XSLT I do not see a problem.
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">

<xsl:template match="/">
        <html>
                <body>
                        <xsl:apply-templates/>
                </body>
        </html>
</xsl:template>

<xsl:template match="Test">
        <xsl:apply-templates/><br/>
</xsl:template>


<xsl:template match="B"> <b><xsl:apply-templates/></b> </xsl:template>

<xsl:template match="I">
        <i><xsl:apply-templates/></i>
</xsl:template>

</xsl:transform>

If wanting to copy your XMl or parts of it make use of xsl:copy-of . This will perform a deep-copy where everything is copied over into your output. SOmehow I get the idea, your not really famailiar with XSLT,.... just yet. :-)

The xsl:value-of returns the concatenated string of your expression, in your case Test.

Look into the functionality of value-of and templates/apply-templates, I think that would clarify a lot.

RH
At 09:53 AM 11/5/01 +0000, you wrote:
Hello again problem solvers

I have another problem that I hope you can help me with, which is somewhat the opposite of a problem I posted last week.

I have an xml document like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml:stylesheet type="text/xsl" href="Test.xsl"?>
<Test>
        This <B>is <I>a </I>Test</B>.
</Test>

And an xsl document to output it on a browser:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
<xsl:template match="/">
        <html>
                <body>
                        <xsl:value-of select="Test"/>
                </body>
        </html>
</xsl:template>
</xsl:transform>

Output is:
This is a Test.

That is, without any of the tags being in effect.
Is there a way that I can do this? The solution should also enable newline (<br/>) tags, if possible.


Thanks in advance
Ragulf Pickaxe :)

_________________________________________________________________



Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


Current Thread