|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Problem with generating sequence ids.
Tempore 15:15:09, die 07/06/2005 AD, hinc in
xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Lakshmi narayana
<lchintala@xxxxxxxxxxxx>:
I am facing the problem to create the IDs to the elements. See the following example XML file. While all replies currently raining down are correct, I thought I might provide a stylesheet that actually follows the algorithm you wrote: <xsl:template match="node()|@*"> <xsl:param name="parentid"/> <xsl:variable name="myid" select="concat($parentid,format-number((ancestor-or-self::*/@sequence)[last()],'000'))"/> <xsl:copy> <xsl:attribute name="id"> <xsl:value-of select="substring(concat($myid,'0000000000000000'),1,15)"/> </xsl:attribute> <xsl:apply-templates select="node()|@*"> <xsl:with-param name="parentid" select="$myid"/> </xsl:apply-templates> </xsl:copy> </xsl:template> -- Joris Gillis (http://users.telenet.be/root-jg/me.html) Spread the wiki (http://www.wikipedia.org)
|
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








