xsl-list
[Top] [All Lists]

Re: Content in html tags

2005-07-05 07:09:38
Hi,

Tempore 15:57:10, die 07/05/2005 AD, hinc in xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com scripsit Aaron Johnson <Aaron2(_dot_)Johnson(_at_)uwe(_dot_)ac(_dot_)uk>:

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)

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>