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: mismatched tags with xsl:if


> I run into the following classical issue :
>
> <xsl:if test="...">
> <tag> <!-- opening tag -->
> </xsl:if>
> ...
> <xsl:if test="...">
> </tag> <!-- corresponding closing tag -->
> </xsl:if>

This basically means you're thinking in terms of writing tags to an output
file, not writing nodes to a tree (you can't write half a node). You have to
find some way of changing the logic to:

<xsl:choose>
<xsl:when test="...">
   <tag>
      <xsl:call-template name="write-content"/>
   </tag>
</xsl:when>
<xsl:otherwise>
  <xsl:call-template name="write-content"/>
</xsl:otherwise>
</xsl:choose>

Mike Kay
Software AG


 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]