This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: choose an "artificial" root node



Thanks a lot for your reply, I had thought about that, it's a possibility,
but the <xsl:number count="*" level="any"> is usable only within the
"template match" itself. I mean, I can't use sth like : <xsl:apply-templates
select=*[xsl:number()=$id] /> so this would mean I'd have to process every
node and compare its number with $id until I reach the one I want... Much
too heavy. Thanks anyway.

----- Original Message -----
From: "by way of B. Tommie Usdin" <owner-xsl-list@lists.mulberrytech.com>
To: "xsl-list" <xsl-list@lists.mulberrytech.com>
Sent: Wednesday, February 14, 2001 7:24 PM
Subject: Re: [xsl] choose an "artificial" root node


> Date: Wed, 14 Feb 2001 17:18:21 GMT
> Message-Id: <200102141718.RAA06761@penguin.nag.co.uk>
> Received: by penguin.nag.co.uk (8.9.3) id RAA06761; Wed, 14 Feb 2001
> 17:18:21 GMT
> From: David Carlisle <davidc@nag.co.uk>
> To: xsl-list@lists.mulberrytech.com
> In-reply-to: <006401c096a7$a0950740$5c4ed686@rfvpc36>
> (schwebel@rfv.insa-lyon.fr)
> Subject: Re: [xsl] choose an "artificial" root node
> References:
> <POEMLHLHPPILCJKHBIAAEEENCAAA.andrew@thebristoldirectory.com>
> <006401c096a7$a0950740$5c4ed686@rfvpc36>
>
>
> >  I thought it would work.... but the generated id is different each time
the
> >  document is loaded ! What is an id good for if it changes everytime ?
>
> the id is unique within a run of the stylesheet so it can be used in
> xslt code to identify a node as in <xsl:if
> test="generate-id(.)=generate-id($xx)">
> or it can be used to generate ids and internal links in teh output so
> long as you don't mind that they are unstable and change if document
> regenerated.
>
> To get stable ids either get them from the source or use something like
> <xsl:number/> to generate a unique id.
> ie <xsl:attribute name="id">foo<xsl:number level="any"
> count="foo"/></xslattribute"/>
>
> will generate attribute values  foo1 foo2 etc on foo elements.
>
> david
>
> _____________________________________________________________________
> This message has been checked for all known viruses by Star Internet
delivered
> through the MessageLabs Virus Control Centre. For further information
visit
> http://www.star.net.uk/stats.asp
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]