Windows extended CHM does not handle <function> properly.

"Richard A. Quadling" <[email protected]> Thu, 5 Jul 2007 11:11:37 +0100
Newsgroups gmane.comp.php.documentation.windows,gmane.comp.php.documentation.general
Message-ID <[email protected]>
Hi.
=20
This is in the Windows Extended CHM file.
=20
Take phpdoc/en/strings/functions/str-repeat.xml
=20
Look in the seealso section.
=20
There is a difference in the way the see also's are entered ...
=20
 <refsect1 role=3D"seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member><link linkend=3D"control-structures.for">for</link></member>
    <member><function>str_pad</function></member>
    <member><function>substr_count</function></member>
   </simplelist>
  </para>
 </refsect1>
=20
Using make chm_xsl this is translated to the file
phpdoc/htmlhelp/html/function.str-repeat.html
=20
The seealso section now looks like (slightly tidied).
=20
<div class=3D"refsect1" lang=3D"en">
 <a name=3D"id5929139"></a>
 See Also
 <p></p>
 <table class=3D"simplelist" border=3D"0" summary=3D"Simple list">
  <tr><td><a href=3D"control-structures.for.html"
title=3D"for">for</a></td></tr>
  <tr><td><b class=3D"function">str_pad()</b></td></tr>
  <tr><td><b class=3D"function">substr_count()</b></td></tr>
 </table>
 <p></p>
</div>

This means that none of the see also link to other functions.
=20
This is further converted into the CHM files as ...
=20
<div class=3D"refsect1" lang=3D"en">
 <a name=3D"id5929139"></a>
 See Also
 <table class=3D"simplelist" border=3D"0" summary=3D"Simple list">
  <tr><td><a href=3D"control-structures.for.html"
title=3D"for">for</a></td></tr>
  <tr><td><b class=3D"function">str_pad()</b></td></tr>
  <tr><td><b class=3D"function">substr_count()</b></td></tr>
 </table>
</div>

(Dropping of empty <p></p> tags).
=20
Still no anchors for the functions.
=20
The xsl code for this (I think) is in
phpdoc/phpbook/phpbook-xsl/common.xsl around line 373-381 ...
=20
<!-- Enclose FUNCTION in links, add parenthesis, make 'em bold. Do not
link if
     current page is description of current function or target is not
available -->
<xsl:template match=3D"function">
  <xsl:variable name=3D"content">
      <b class=3D"{local-name(.)}">
         <xsl:apply-templates/>
          <xsl:text>()</xsl:text>
      </b>
  </xsl:variable>

I suspect this is incorrect.
=20
=20
I think I could change it so that the an <a> tag is created, but I don't
know how to obey the rest of the comment "Do not link if current page is
description of current function or target is not available".
 =20
The common.xsl was last changed on   $Id: common.xsl,v 1.4 2007/06/20
22:25:41 bjori Exp $
=20
The online version of this page was generated on 2007/06/17 and doesn't
show this problem.

I looked at other xsl files that deal with <xsl:template
match=3D"function"> and they are quite different.

The one in html-chunk.xsl looks the most promising ...

  <xsl:choose>
    <xsl:when test=3D"(ancestor::refentry/@id=3D$targetid or
ancestor::sect1/@id=3D$targetid)
                    or string-length($targetid) =3D 0">
      <b><xsl:copy-of select=3D"$content"/></b>
    </xsl:when>
    <xsl:otherwise>
      <a>
        <xsl:attribute name=3D"href">
          <xsl:value-of select=3D"concat($targetid,$html.ext)"/>=20
        </xsl:attribute>
        <xsl:copy-of select=3D"$content"/>
      </a>
    </xsl:otherwise>
  </xsl:choose>

But I don't know anywhere NEAR enough to even try this out. I don't know
XSL at all (though I think I can guess).=09
=20
Regards
=20
Richard Quadling.

-- 
PHP CHM Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php