[projectaon] <bookref>

  • From: Thomas Wolmer <angantyr@xxxxxxxxx>
  • To: projectaon@xxxxxxxxxxxxx
  • Date: Sun, 25 Dec 2005 21:15:48 +0100

2005/12/25, Thomas Wolmer <angantyr@xxxxxxxxx>:
> [ ] Jon - clarify the intentions with <footref> and <bookref>
>
> 2005/12/22, Thomas Wolmer <angantyr@xxxxxxxxx>:
> > 2005/12/21, Iain Smith <iainsmith@xxxxxxxxx>:
> > > Are you sure?  I tried changing the footnote markers inside the paragraph 
> > > text to use
> > > <footref> as you suggested, however the produced HTML pages no longer 
> > > contain the
> > > footnote link.
> > >
> > > I've not read the whole DTD, but in the region around line 490 it still 
> > > refers to the
> > > need for an <a> section within the paragraph text.
> > >
> > > Maybe the XSL isn't ready to accept the changes referred to in the DTD, 
> > > or did I just
> > > misunderstand what you were trying to say?
> >
> > Hm, I went by what I read in the DTD. I would guess that the XSL is
> > not ready... no, I claim to know that the XSL is not ready, as it does
> > not handle the footref element at all. I wonder if the intention was
> > to treat the <footref>s exactly as the existing <a>nchors, or in some
> > other way?
>
> I also noticed that the <bookref> element is not supported by the XSL
> either. Am I right in assuming that <bookref book="$book"
> section="$section">blah blah text</bookref> shall be transformed into
> <a href="../../$series/$book/$section.htm">blah blah text</a>, where
> $series is always the same as for the book you are transforming and
> $section defaults to "title" if it's left out?

No wait, we don't have access to the series identity. Better than
provising it as a parameter or parsing it out from something else,
would be to let $book include the series, e.g. "lw/11tpot". At the
same time that one can pretend that this is a logical name that only
accidently happens to coincide with an ugly file path, it also gives
the benefits that:

* One can refer to books in another series.
* Any future foreign language editions where book #X in series A and B
both have the same abbreviation won't have to come up with some
contrived solution for this.

My possibly dodgy XSL code for this:

<xsl:template match="bookref">
 <a>
  <xsl:attribute name="href">
   <xsl:variable name="my-section">
    <xsl:choose>
     <xsl:when test="@section">
      <xsl:value-of select="@section" />
     </xsl:when>
     <xsl:otherwise>
      <xsl:text>title</xsl:text>
     </xsl:otherwise>
    </xsl:choose>
   </xsl:variable>
   <xsl:text>../../</xsl:text><xsl:value-of select="@book"
/><xsl:text>/</xsl:text><xsl:value-of select="$my-section"
/><xsl:text>.htm</xsl:text>
  </xsl:attribute>
  <xsl:apply-templates />
 </a>
</xsl:template>

The current XSL template for <a href="..."> has handling of the 'id'
attribute. What is this for? I cannot find any place where it is
currently used.

I haven't checked it in the above yet, in case I misunderstood the intention...

--
Thomas

Other related posts: