Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.6
    • Fix Version/s: 0.7
    • Component/s: Core operations
    • Labels:
      None
    • Environment:
      Any

      Description

      I have some problems with the toc. I use accents for my title and the links generated in the TOC for these titles are broken.

      My source code is :
      |<section>
      |<title>Cassé</title>

      The Toc generated is

      |"<a href="#Cass%E9s">Cassé</a>"

      This link can't be used.

      I found a solution : I modified the file sitmap.xmap (line 90-94)
      The initial source is
       |<!-- Generates @id attributes from <title> strings -->
       | <map:transformer name="idgen"
       |src="org.apache.cocoon.transformation.IdGeneratorTransformer">
       | <element>//*[local-name() = 'section']</element>
      *| <id>title/text()</id>
       | </map:transformer>

      My change :
       |<!-- Generates @id attributes from <title> strings -->
       | <map:transformer name="idgen"
       | src="org.apache.cocoon.transformation.IdGeneratorTransformer">
       | <element>//*[local-name() = 'section']</element>
      *| <id>generate-id()</id>
       | </map:transformer>
      The changed line begins with '*'.
      This is the simplest workaround I found.
      HTH.
      Fred

        Activity

        Hide
        rgardler Ross Gardler added a comment -
        Linda Rose had a similar problem:

        > I have an html source file with links to named anchors. When I convert it using Forrest, the named anchors seemed to be stripped out, see http://www.alexandria.ucsb.edu/adl/docs_software/site/devguide/SBD.html and scroll down to the Geographic locations link. It's suppose to link to a named anchor further down in the file. Is there a better way to create links within a file?


        Looking at that the source of that document I see that the link is marked up as:

        <strong><a href="#geoloc">Geographic locations</a></strong>

        whilst the intended destination of the link is:

        <a name="adl%3Ageographic+locations"></a>
        <h3 class="underlined_5">adl:geographic locations</h3>

        What appears is happening is Forrest is rewriting the anchor name for use in the table of contents, thus breaking your original link. This is a bug (probably in html2document.xsl), please submit it to the issue tracker and if you patch the file please add the patch to the issue too.

        Ross
        Show
        rgardler Ross Gardler added a comment - Linda Rose had a similar problem: > I have an html source file with links to named anchors. When I convert it using Forrest, the named anchors seemed to be stripped out, see http://www.alexandria.ucsb.edu/adl/docs_software/site/devguide/SBD.html and scroll down to the Geographic locations link. It's suppose to link to a named anchor further down in the file. Is there a better way to create links within a file? Looking at that the source of that document I see that the link is marked up as: <strong><a href="#geoloc">Geographic locations</a></strong> whilst the intended destination of the link is: <a name="adl%3Ageographic+locations"></a> <h3 class="underlined_5">adl:geographic locations</h3> What appears is happening is Forrest is rewriting the anchor name for use in the table of contents, thus breaking your original link. This is a bug (probably in html2document.xsl), please submit it to the issue tracker and if you patch the file please add the patch to the issue too. Ross
        Hide
        duc Cyriaque Dupoirieux added a comment -
        Here is a patch which update the org/apache/forrest/util/IdGeneratorTransformer.java in order to call the new URLEncoder.encode(id, format) method which allows to force the encoding to "UTF-8".
        Tested on my machine it works very well...
        Show
        duc Cyriaque Dupoirieux added a comment - Here is a patch which update the org/apache/forrest/util/IdGeneratorTransformer.java in order to call the new URLEncoder.encode(id, format) method which allows to force the encoding to "UTF-8". Tested on my machine it works very well...
        Hide
        rgardler Ross Gardler added a comment -
        Patch applied - thanks
        Show
        rgardler Ross Gardler added a comment - Patch applied - thanks

          People

          • Assignee:
            rgardler Ross Gardler
            Reporter:
            deniger Frédéric Deniger
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development