Subject: RE: [xsl] Selecting "distinct" elements From: "Michael Kay" <mhk@xxxxxxxxx> Date: Sat, 27 Sep 2003 17:39:15 +0100 |
> Hi > I want to select one of each element with a certain attribute > value and loop over these elements in a for-each (or possibly > apply-templates). Is this possible with a single select > statement or do I have to make a more cumbersome solution? If > possible, how would a statement solving the problem look like? Read all about grouping at http://www.jenitennison.com/xslt/grouping Michael Kay > > Instance document: > <root> > <element value="a"/> > <element value="b"/> > <element value="a"/> > <element value="c"/> > <element value="b"/> > <element value="d"/> > <element value="b"/> > </root> > > XSLT Template: > <xsl:template match="root"> > <xsl:for-each select="[insert your favourite statement here]"> > <anotherElt value="{@value}"/> > </xsl:for-each> > </xsl:template> > > Resulting document: > <root> > <anotherElt value="a"/> > <anotherElt value="b"/> > <anotherElt value="c"/> > <anotherElt value="d"/> > </root> > > Thanks, > > /Marcus > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Re: Selecting "distinct" elem, Dimitre Novatchev | Thread | [xsl] How can I return all urls in , Brian Benson |
Re: [xsl] Parameters query, J.Pietschmann | Date | RE: [xsl] document function support, Michael Kay |
Month |