You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by "J.Pietschmann" <j3...@yahoo.de> on 2003/01/27 00:12:45 UTC

intra-FAQ links

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

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

J.Pietschmann


Re: intra-FAQ links

Posted by Jeff Turner <je...@apache.org>.
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
> 

Re: intra-FAQ links

Posted by Jeff Turner <je...@apache.org>.
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...
> 
> 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.

Fixed.

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

Fixed.

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

Worked nicely, and now committed.

http://forrestbot.cocoondev.org/sites/xml-forrest/faq.html


--Jeff
> 
> J.Pietschmann
>