|
Subject: Re: xsl:if formatting problem From: Phil Lanch <phil@xxxxxxxxxxxxxxx> Date: Fri, 31 Mar 2000 14:57:45 +0100 |
Phillip Padgett wrote:
>
> file:/usr/users/pdp/webs/stylesheets/general.xsl:59: mismatched end tag:
> expected "td" but got "xsl:if"
>
> I realize it wants me to close the td but I want to close it later. What
> is the way around this? Alternatively it seems I have to write many more
you can put the inner part of your XSL into a separate template-
<xsl:template name="content">
<xsl:if test="string-length(@header)=0">
<xsl:apply-templates select="document($header-fancy)"/>
</xsl:if>
<xsl:if test="string-length(@header)>0">
<xsl:apply-templates select="document($header)"/>
</xsl:if>
</xsl:template>
-& then use an xsl:choose, instead of a plain xsl:if, to call that template
with or without the <table> wrapping-
<xsl:choose>
<xsl:when test="string-length($centeroffset)>0">
<table width="100%"><tr>
<td width="{$centeroffset}"/>
<td><xsl:call-template name="content"/></td>
</tr></table>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="content"/>
</xsl:otherwise>
</xsl:choose>
--
cheers
phil
"The cab company the card in Alkan's bathroom referred to
was easily found. It was a cubbyhole tenanted by an Italian
speaker in a flat tweed cap. He made no sign of remembering
a tall, thin man, somewhat like Le Corbusier. Indeed, it could
have been a resistance to the Modernist movement as a whole that
made him so abusive towards me when I pressed him for information."
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| xsl:if formatting problem, Phillip Padgett | Thread | Re: xsl:if formatting problem, David Carlisle |
| Re: Dumb question from a newbie on , Dan Morrison | Date | xsl:if formatting problem, Phillip Padgett |
| Month |