[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Generating Unique ID

Subject: RE: Generating Unique ID
From: "Arun Sinha" <arunsinha666@xxxxxxxxxxx>
Date: Tue, 06 Dec 2005 08:54:29 +0000
javascript generate unique id
Hi Ragulf,

Actualy the HTML page that I am producing has a drilldown facility.
When the page is called for the first time only the level one data is shown with closing folder
picture. When the folder is clicked then the next level data is shown.


To get this working the javascript, that we have, needs IDs like that.

Best Regards.

Arun




From: "Ragulf Pickaxe" <ragulf.pickaxe@xxxxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  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:for-each>
</xsl:variable>
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:attribute name="ID"><xsl:value-of select="$special-id"/></xsl:attribute>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>


Is the above what you need?

Regards,
Ragulf Pickaxe :-)

_________________________________________________________________
Find det, du sxger pe MSN Sxg http://search.msn.dk

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.