xsl-list
[Top] [All Lists]

Re: [xsl] Using COUNT to create unique anchors

2006-11-27 09:56:30
On 11/27/06, Austin, Darrel 
<Darrel(_dot_)Austin(_at_)courts(_dot_)state(_dot_)mn(_dot_)us> wrote:
I'm recursively going through my XML file to create a table of contents
for a document. I want to be able to link each item on the TOC to the
proper anchor later on the page.

[snip]

The 'easy' solution would be for me to just store the unique ID stored
in the database for each node within the XML itself, but I was wondering
if there was a solution on the XSL side of things before I recreate the
XML files.

Just use generate-id() - it's guaranteed to return the same value for
the same node for a single transformation run.

So when you pass over your data to create your index, and then when
you pass over it a second time to do the actual transform, as long as
its all done as part of a single transform you can use generate-id()

cheers
andrew

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--