xsl-list
[Top] [All Lists]

Re: [xsl] Generating Unique Identifier

2011-10-22 15:16:52
Thank you very much; sounds like that might work.

Lighton Phiri
lighton(_dot_)phiri(_at_)lightonphiri(_dot_)org
http://lightonphiri.org/
@lightonphiri




On 22 October 2011 22:02, G. Ken Holman 
<gkholman(_at_)cranesoftwrights(_dot_)com> wrote:
At 2011-10-22 21:49 +0200, you wrote:

Sorry if my question was not very clearly, but I have two seperate
stylesheets that each  generate html files.

Oh, that's new.  I did not understand you were using two invocations of two
separate stylesheets.  Yes, you cannot rely on generate-id() across two
different runs of the XSLT processor (even the same processor, even if the
content of the inputs doesn't change; it may coincidentally be okay for a
particular processor, but then the stylesheet isn't portable).

File 1 html output has content that is referenced by File 2 output.

The problem is that I am unable to find a suitable way of generating.
I was hoping there could perhaps be a way of generating a UNIQUE
identifier common to both output files other than using generate-id().

How about using <xsl:number/> in creating file 1's HTML output, then when
creating file 2's output look up file 2's input value in file 1 and use the
same <xsl:number/> calculation on that file 1 location?

So, file 1 input has a value, file 1 output names the anchor based on
<xsl:number/>.

Then, file 2 input has a value, look up that value in file 1, file 2 output
then names the anchor based on <xsl:number/> of that value found in file 1.

So, you are using only one algorithm, that being file 1's results of
<xsl:number/> but file 2 is exploiting it by looking up its value in file 1.

I hope this helps.  I'm only guessing since in both of your posts you did
not illustrate how each of file 1 and file 2 find or use that which you need
to be common.

. . . . . . . . . . Ken


--
Contact us for world-wide XML consulting and instructor-led training
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/
G. Ken Holman                   
mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Google+ profile: https://plus.google.com/116832879756988317389/about
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
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>
--~--



--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>