|
Subject: Re: first-of-type From: "Clark C. Evans" <clark.evans@xxxxxxxxxxxxxxxxxxxx> Date: Sat, 2 Oct 1999 21:50:06 -0400 (EDT) |
Found the answer! (perhaps this is a good FAQ) ?
<xsl:template match="y">
<tr><td>
<xsl:if test="not(preceding-sibling::reference)">
y
</xsl:if>
</td><td>
<xsl:value-of select="."/>
</td></tr>
</xsl:template>
Nice. I'm impressed.
;) Clark
On Sat, 2 Oct 1999, Clark C. Evans wrote:
> Hello. I'm looking for the replacement for
> the 'first-of-type' predicate.
>
> Input:
>
> <p>
> <x> content for first x </x>
> <y> content for first y </y>
> <y> content for second y </y>
> <z> content for first z </z>
> <p>
>
> I'd like output:
>
> <table>
> <tr><td>x</td><td>content for first x </td></tr>
> <tr><td>y</td><td>content for first y </td></tr>
> <tr><td> </td><td>content for second y </td></tr>
> <tr><td>z</td><td>content for first z </td></tr>
> </table>
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| first-of-type, Clark C. Evans | Thread | decode( source,'if-one','1', ... , , Clark C. Evans |
| first-of-type, Clark C. Evans | Date | Re: meaning of "contain" in the XSL, James Clark |
| Month |