Question about possibilities of XSLT / generate unique ID and reuse it

D

Daniel Hilgarth

Hello,

I am currently trying to use XSLT for the creation of multiple
HTML-files from a single XML-File.
This HTML-files need to have links to each other.
The following information might be important:
There are some special nodes that will start a new HTML-page
("page-nodes"). Those nodes can be nested.
Those nodes have an attribute "name" which is not necessarily unique.
There are another special nodes that will create a link in one HTML-Page
to another. Those nodes uses the values of the "name"-attribute to
distinguish the special node that is referenced.
Now my problems: I could create unique numbers in the page-nodes with
xsl:number. But I am not able to find out that number again later in a
different template. The problem is not, that I don't know which node is
referenced, but the problem is that I am simply not able to get that
number via xsl:number, because of the way this tag works.

Any hints and ideas are very welcome.

Kind regards,
Daniel Hilgarth
 
M

Martin Honnen

Daniel said:
I am currently trying to use XSLT for the creation of multiple
HTML-files from a single XML-File.
This HTML-files need to have links to each other.
The following information might be important:
There are some special nodes that will start a new HTML-page
("page-nodes"). Those nodes can be nested.
Those nodes have an attribute "name" which is not necessarily unique.
There are another special nodes that will create a link in one HTML-Page
to another. Those nodes uses the values of the "name"-attribute to
distinguish the special node that is referenced.
Now my problems: I could create unique numbers in the page-nodes with
xsl:number. But I am not able to find out that number again later in a
different template.

If you want a unique id, have you tried the generate-id function
<http://www.w3.org/TR/xslt#function-generate-id>
that XSLT provides? That way you can generate an id from a node and it
is unique. You just need to make sure you pass the same node to the
function when you need the id for a second time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top