forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steven Noels" <>
Subject RE: Sections & anchors
Date Sat, 18 May 2002 15:52:49 GMT

> > >I see that the latest document2html.xsl generates anchors
> to sections
> > >automatically (somebody told that he don't like automatic
> > documents ;) ). Is

oops :-)

> > >there an idea on how to create links to those anchors? If
> > they are generated
> > >during the tranformation then it's impossible to have jumps
> > in the document
> > >like "See 'section 1' for this".
> > >
> > >Any idea?

would that be links to elements labeled using the id attribute, or any
possible infra-document XPath expression?

> Yes, I know and this is implemented already in
> document2html.xsl. But you
> got me a little wrong. I'd like to have in the content part a
> link to other
> section, say:
>  <article>
>     <section>
>        <title>blah b;ah b;ah</title>
>        <para>blah b;ah b;ah. See <jump href="../section[2]"/></para>
>     </section>
>     <section>
>        <title>bloh b;oh b;oh</title>
>        <para>bloh b;oh b;oh</para>
>     </section>
>  </article>
> Is it possible without dynamic XPath evaluation (which is
> supported only in
> XSLT 2.0)?

Hm.... sounds like XPointer, which also solves the link to ID'ed
elements using the id() function. That would be nice, indeed.

Bruno, how about reviving your XPointer skills?

The main issue will be that the target document(s) would need to be
processed too before we can establish an HTML rendition of such a link,
and that will be depending on the kind of link being created:

<link href="document.html#id('section-id')"> can be rendered as a simple
<a href/> -> <a name/> HTML link, whereas <link
href="document.html#section[@distribution='internal'][2]"> would need to
generate-id's for all HTML section elements (<div>, presumably) and have
these generated id's being use in the generated linking element <a

And yes, we all know that these generated ID's are depending on XSLT
processor, time of the day and current weather, i.e. they cannot be
guaranteed to be identical across runs.

Conclusion: if you want to link a specific section of a document, add an
id attribute to that section and link to that id, the stylesheet will
create the appropriate <a name/> element in the destination document (if
not, I'll patch that). As far as XPointer is concerned... mmmmm... that
would be very nice, indeed!


View raw message