Subject: Re: [xsl] Selecting uniquely one 'asset' in XSL From: "Vasu Chakkera" <vasucv@xxxxxxxxxxx> Date: Thu, 25 Apr 2002 09:31:41 +0000 |
<asset>Diamonds</asset> <asset>Diamonds</asset> </assets>
From: "Craig Aranjo" <aranjo@xxxxxxxxxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: <XSL-List@xxxxxxxxxxxxxxxxxxxxxx> Subject: [xsl] Selecting uniquely one 'asset' in XSL Date: Thu, 25 Apr 2002 09:40:06 +0100
This seems an a trivial problem but I just can't seem to get my head around
it. I want to be able to select one unique 'asset' name from multiple assets
(there are more than 1 asset of the same type) from XML document and display
this in (say) a HTML table. Further entries of the same asset also need to
appear except that the table entry for the asset name will be blank for the
remainder assets.
The XML document looks something like this:
<asset>Oil</asset> . <asset>Oil</asset> . <asset>Diamonds</asset> . <asset>Diamonds</asset>
Here are two attempts of mine when creating the XSL stylesheet:
1:
<xsl:for-each select="parent::asset"> <xsl:if test="position() = 1"> <xsl:apply-templates selectparent::asset"/> </xsl:if> </xsl:for-each>
2.
<xsl:variable name="assetname" select="//asset-name[not(.=preceding::asset-name)]"/> <xsl:apply-templates select="$assetname"/>
Neither of these achieve the desired result. Could someone please point me in the right direction.
regards, Craig
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Selecting uniquely one 'asset, Craig Aranjo | Thread | [xsl] xsk doubt [ ] vs ( ), william locksman |
RE: [xsl] Another XSL question, Michael Kay | Date | [xsl] xsk doubt [ ] vs ( ), william locksman |
Month |