Hello, what about to have fragment identifier in pages.xml, I can imagine something like smart help page which gives you the right chapter according to page where you are:
<page view-id="/*">
<rule if-outcome="help">
<redirect view-id="/help.xhtml"/>
</rule>
</page>
<page view-id="/applicationOne/*">
<rule if-outcome="help">
<redirect view-id="/help.xhtml" fragment="chapOne"/>
</rule>
</page>
<page view-id="/applicationTwo/*">
<rule if-outcome="help">
<redirect view-id="/help.xhtml" fragment="chapTwo"/>
</rule>
</page>
So the result link in the second application will be like:
/myApp/help.xhtml#chapTwo
It will be much easier than dynamically generate s:link's fragment attribute for each xhtml page.