Ferdinand Soethe wrote:
During some involuntary testing of treatment of local anchors in
HTML-pages I found a rather unnerving 'feature'.

If a local anchor like

<h2><a name="myanchorID">My visible headline</a></h2>

is processed by Forrests default treatment, the anchor is
'disappeared' and replaced by the following code:

<a name="N10016"></a><a name="My+visible+headline"></a>
<h3 class="boxed">My visible headline</h3>

This is no problem for Forrest internally as it uses its new
self-generated anchors, but it is if you have other pages referencing
this section by using the original anchor name.

And unless your page is really static, you cannot even use the new
anchors to reference this section as the

- numeric anchor will change each time the structure of your page
  changes while

- the text based anchor depends on the text of your heading (which
  might change as well).

The auto generated anchors are for Forrests internal use so it does not matter that they may change. If you want to manually create link to a part of your page you should define the anchor name yourself in the code. Of course, this is exactly your problem, your manually defined anchors are being dropped.


Everything works fine for xdocs, so it must be a problem with html2document.xsl. Can you work out where your anchors are being lost. Try retrieving your page as an xdoc (by requesting http://localhost:8888/myLegacyHTMLFile.xml). Do you see your anchors in there? If not then it is confirmed as an html2document.xsl issue.

Can you enter a bug on the issue tracker and record any of your findings there.

My question: Could transformation not preserve existing anchors in
an html-page and - in case of conflict - adjust its autogenerated
anchors to avoid the conflict.

The avoiding conflict thing would be a good idea, but not a priority right now as it is unlikely to happen. Please create a feature request for this. If it becomes a problem then we can solve it.


Ross




Reply via email to