xsl-list
[Top] [All Lists]

Re: [xsl] Check if next tag is ...

2006-12-15 02:11:05

 You can use something like this (but you didn't say if you are using
XSLT 1.0 or 2.0):

I intent to stick to 1.0.

   <xsl:template match="C">
     <xsl:variable name="empty-t" as="element()">
       <T>*</T>
     </xsl:variable>
     <table-line>
       <xsl:apply-templates select="
           P, if ( T ) then T else $empty-t, S"/>
     </table-line>
   </xsl:template>

   <xsl:template match="P|T|S">
     <table-cell>
       <xsl:value-of select="."/>
     </table-cell>
   </xsl:template>

Cheers, I will give this a go.

Anne.


--~------------------------------------------------------------------
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>