My colleague Radu asked me to help you with these extensions.
1. The first step is to define a custom anchor. On the link
property you should specify an URL with an anchor that contains everything needed to compute, later on, the target:
You will need a custom Link Target Element Finder
that will know how to use this anchor and identify the target element.
2. Since you are using a custom anchor, you will also need a customized version of the DocbookLinkTextResolver
that, again, will know how to interpret the special anchor
To crete these extensions I suggest:
1. You should download the Oxygen SDK
. Afterwards, focus on the submodule called oxygen-sample-framework
. After executing a mvn generate-resources
you will notice a samples directory which will contain the DocbookLinkTextResolver
2. Also add the [OXYGEN_INSTALL_DIR]\frameworks\docbook\docbook.jar to the class path of the project.
3. Create a class that extends ro.sync.ecss.extensions.docbook.DocBook5ExtensionsBundle
and overwrites the methods:
3.1 ro.sync.ecss.extensions.api.ExtensionsBundle#createLinkTextResolver() and returns the extension of DocbookLinkTextResolver that handles the special anchor.
3.2 and ro.sync.ecss.extensions.api.ExtensionsBundle#createElementLocatorProvider() and returns an extension of ro.sync.ecss.extensions.commons.DefaultElementLocatorProvider that handles the special anchor
If you take a look at the DocbookLinkTextResolver
code you will notice that it actually keeps a cache. Please let me know how it goes.