Re: [xsl] Content in html tags

Subject: Re: [xsl] Content in html tags
From: "Joris Gillis" <roac@xxxxxxxxxx>
Date: Tue, 05 Jul 2005 16:09:38 +0200
Hi,

Tempore 15:57:10, die 07/05/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Aaron Johnson <Aaron2.Johnson@xxxxxxxxx>:

Here is an xslt...It's supposed to allow me
to wrap the content in html tags when required. Clearly it's malformed
xml, so how can I achieve it without repeating the "Testing!" section?

Put the "Testing!" section section in a (named) template and use conditional testing (xsl:if or xsl:choose)


example:

<xsl:template match="/">
    <xsl:if test="$stylusStudio='true'">
        <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
            <head>
                <title>UWE Reenrolment</title>
                <link rel="stylesheet" type="text/css"
href="http://my.uwe.ac.uk/uPortal/media/org/jasig/portal/layout/AL_TabColumn
/integratedModes/myuwe/skin/myuwe.css"/>
            </head>
            <body>
				<xsl:call-template name="mytemplate"/>
            </body>
        </html>
    </xsl:if>
    <xsl:if test="$stylusStudio='false'">
		<xsl:call-template name="mytemplate"/>
	</xsl:if>
    </xsl:template>
	
	<xsl:template name="mytemplate">
		Testing!
	</xsl:template>

regards,
--
Joris Gillis (http://users.telenet.be/root-jg/me.html)
Spread the wiki (http://www.wikipedia.org)

Current Thread