forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <je...@apache.org>
Subject Re: intra-FAQ links
Date Sun, 26 Jan 2003 23:41:50 GMT
On Mon, Jan 27, 2003 at 12:12:45AM +0100, J.Pietschmann wrote:
> Hi there,
> we have some links within our FAQ, pointing to other questions.
> Unfortunately, the links don't appear to work. I guess this is
> because we use for example
>   <faq id="postquestions">
> and
>   <link href="#postquestions">...
> 
> In faq2document.xsl, the relevant template seems to be
>    <xsl:template match="faq">
>     <anchor id="faq-{generate-id()}"/>
>     <section>
>     ...
> It is not obvious an anchor for the question's ID is
> generated.
> 
> Q: Should't an anchor be generated for, well, basically
> everything? In doc-v11.mod there is a comment:
>    <!-- Common attributes
>         Every element has an ID attribute (sometimes required,
>         but usually optional) for links.
>    ...
> It's not of much use if the style sheets ignore it...

You're right, and I'm just about to commit an improved faq2document.xsl
that uses @id (if present).

> Are there other ways to make intra-FAQ links work?
> 
> And, well, the skinning of FAQs could use some improvement.
> I'd like have the faqsections (damn, *parts*) numbered,
> as well as the questions within the sections. Also, some
> indendation would really help to keep track which text belongs
> to which question.
> 
> Well, another flaw:
>   <xsl:template match="faq">
>     <anchor id="faq-{generate-id()}"/>
>     <section>
>      <title>
>       <xsl:value-of select="question"/>
>      </title>
> The DTD allows inline markup in questions, therefore it would
> be appropriate to use xsl:apply-templates.
> 
> A patch for most of the above:
>   <xsl:template match="faq">
>     <anchor id="faq-{generate-id()}"/>
>     <xsl:if test="@id">
>       <anchor id="{@id}"/>
>     </xsl:if>
>     <section>
>      <title>
>        <xsl:number level="multiple" count="faq|part" format="1.1. "/>
>        <xsl:apply-templates select="question"/>
>      </title>
> 
> Well, the xsl:number part is completely untested...

I'll have a look at the numbering.

--Jeff

> 
> J.Pietschmann
> 

Mime
View raw message