RE: [xsl] Generating Unique ID

Subject: RE: [xsl] Generating Unique ID
From: "Arun Sinha" <arunsinha666@xxxxxxxxxxx>
Date: Thu, 08 Dec 2005 12:14:03 +0000
Thank you all for the help provided on generating the unique ID.

Best Regards.


From: "Ragulf Pickaxe" <ragulf.pickaxe@xxxxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] Generating Unique ID
Date: Tue, 06 Dec 2005 09:35:23 +0100

Hi Arun,

Why do you need the id to contain its parents id as well?

You have a function, generate-id(), which generates a unique id on a node.

If you need an id like what you state, you will need to do something like this (a variation of identity template):

<xsl:template match="*">
<xsl:variable name="special-id">
<xsl:for-each select="ancestor-or-self::*">
<xsl:value-of select="generate-id(.)"/>
<xsl:copy-of select="@*"/>
<xsl:attribute name="ID"><xsl:value-of select="$special-id"/></xsl:attribute>

Is the above what you need?

Ragulf Pickaxe :-)

Find det, du sxger pe MSN Sxg

Current Thread