[xsl] Q re Fo internal linking (& xslt processing algorithm)

Subject: [xsl] Q re Fo internal linking (& xslt processing algorithm)
From: "Khaled Aly" <ka.aly@xxxxxxxxxx>
Date: Mon, 29 Oct 2007 22:45:58 +0200
Hi

I've got this little problem of producing Fo ToC entries' hyper-links to
their respective pages (or page positions). The DTD has no ID type
attributes that could be used in the xslt based on their xml document
element associations.

I create the ToC within the root template (directly in the xslt file using a
"front pages" Fo page sequence, since there is no ToC xml element. It is
positioned before the apply-templates instruction that walks down the tree.
It was no problem to generate page numbers using <fo:page-number-citation
ref-id="{generate-id()}"/> within the ToC table cell that should contain the
page #, paired with an id="{generate-id()} attribute within the page title
block, defined in a downstream page title template. I don't understand
precisely how these two randomly generated id's are paired to match for a
number of page/section title elements, while they were created
independently, but it works!

What I can't get to work is the use of fo:basic-link with an
internal-destination attribute so that the page corresponding to a title can
be reached by clicking its ToC title. I assigned the following value to the
internal-destination attribute: <xsl:value-of select="child::node()/@id"/>
(the subject fo:block is the only child). But the *.fo file comes with an
empty id. That's what I get in proper fo positions: <fo:basic-link
internal-destination=""/>.

Is it that the @id is not known/generated at this early point of processing
where the template being applied is the root, or is there something v. basic
wrong with my xpath expression?

I hope I managed to describe this clearly as I couldn't find it v. practical
to cite just the relevant code. It seems to me that this should be a typical
issue with a standard solution. Just the implementations may be different.

Many thanks.
ka

Side note: Are there available resources that describe in an accurate
informal-algorithmic way the procedure followed by xslt processors
(generically or for a particular processor) in evolving the internal data
structures representing both template rules and both input and result nodes;
towards resolving all template rules and generating the complete output
tree? Some things are intuitively clear but some cases, may be like my above
issue, cannot be guessed (at least as it seems to me!). I could find general
descriptions to different xslt processing aspects, but failed to find a
complete algorithm-like description that leaves little room for ambiguities.

Current Thread