|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: This could be simple, but not for me!
> Thanks, Andrew
>
> This is very very close to what I need. But the city name has
> to be there only once for all names like:
>
>
> 100, Red
> City1
> Name1
> Name10
> Name100
> ...etc
>
> City2
> Name4
> Name40
> ...
>
> 200, Blue
> City1
> Name2
> Name20
> ...
>
> City2
> Name5
> ...
>
> 300, Green
> City1
> Name3
> Name30
> Name300
> Name3000
> ...
>
> 400, Yellow
> City2
> Name6
> ...
>
> Is that possible as well?
Sure, just add an extra key and an if test around the value-of to check
if it's the first occurance of that value:
<xsl:key name="cities" match="City" use="."/>
and the if test:
<xsl:if test="generate-id(ancestor::Community/City) =
generate-id(key('cities',ancestor::Community/City)[1])">
<span><xsl:value-of select="ancestor::Community/City"/></span>
</xsl:if>
Now, this might fail at the moment because I'm guessing at the structure
of your xml, if its anything other that one <City> per <Community> then
you will need to adjust it.
cheers
andrew
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








