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

Re: generating a repeatable unique id

Subject: Re: generating a repeatable unique id
From: Colin Muller <colin@xxxxxxxxxxxxxx>
Date: Mon, 30 Jul 2001 19:21:24 +0800
colin muller
On Mon, Jul 30, 2001 at 11:25:14AM +0100, Sebastian Rahtz wrote:
> Colin Muller writes:
> 
>  > If the doc hasn't changed, you could arrive at the same count during
>  > your XSLT processing when the later request comes in
> 
> OK, so I know I want "div-645" when I enter the document, so I do
> 
> <xsl:apply-templates select="descendant::div[645]"/>
> 
> but that sounds a bit expensive? I suppose I should trust the
> processor. can the select attribute be constructed with xsl:attribute?

I was thinking more along the lines of (please excuse any bum syntax
below - written in haste by a non-guru; the principle should be clear):

<xsl:template match="//div">
<xsl:variable name="seq"><xsl:number level="any" count="*"/></xsl:variable>
    <xsl:if test="$seq=$param_passed_in">
	<xsl:apply-templates select ="."/>
    </xsl:if>
</xsl:template>

where param_passed_in was generated by:
<xsl:number level="any" count="*"/>
in the original document

I'm entirely unsure whether this would stress the processor - it's an
idea I haven't yet tried out.

Colin


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.