Custom styling of xrefs in CSS?

Hi, I need to customize display of DocBook xref elements pointing to figures. Such xrefs shouldn't display title of referenced figure, but instead figure number should be displayed (something like Figure 3.2). I was reading documentation but my impression is that this can't be done in pure CSS with oXygen extensions. Instead I have to implement my own LinkTextResolver: https://www.oxygenxml.com/InstData/Editor/SDK/javadoc/ro/sync/ecss/extension... Is that right assess or have I missed something? Also will LinkTextResolver work in Web Author? In this particular case it would be useful to have access to content generated by :before on the link target. For example with function like oxy_link-text-before() my problem could be easily solved as: xref { content: oxy_link-text-before(); } Many thanks in advance, Jirka -- ------------------------------------------------------------------ Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz ------------------------------------------------------------------ Professional XML and Web consulting and training services DocBook/DITA customization, custom XSLT/XSL-FO document processing ------------------------------------------------------------------ Bringing you XML Prague conference http://xmlprague.cz ------------------------------------------------------------------

Hello, The LinkTextResolver API should work in Web Author but you will not be able to read the counter value - there is no API for this. You can try to compute the counter yourself. A second problem is that the text of the link will not be updated when a figure is inserted or deleted. You will have to trigger these updates yourself. Can you give more details about what users are trying to achieve using this text for Figure references? I understand its utility in a printed PDF, but in this case you will not have to update the link text when a figure changes. So, the solution would be simpler if needed only for printing. Best, Cristian On 12/5/2018 6:09 PM, Jirka Kosek wrote:
Hi,
I need to customize display of DocBook xref elements pointing to figures. Such xrefs shouldn't display title of referenced figure, but instead figure number should be displayed (something like Figure 3.2).
I was reading documentation but my impression is that this can't be done in pure CSS with oXygen extensions. Instead I have to implement my own LinkTextResolver:
https://www.oxygenxml.com/InstData/Editor/SDK/javadoc/ro/sync/ecss/extension...
Is that right assess or have I missed something? Also will LinkTextResolver work in Web Author?
In this particular case it would be useful to have access to content generated by :before on the link target. For example with function like oxy_link-text-before() my problem could be easily solved as:
xref { content: oxy_link-text-before(); }
Many thanks in advance,
Jirka
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com https://www.oxygenxml.com/mailman/listinfo/oxygen-user

On 6.12.2018 14:01, Cristi Talau wrote:
Can you give more details about what users are trying to achieve using this text for Figure references? I understand its utility in a printed PDF, but in this case you will not have to update the link text when a figure changes. So, the solution would be simpler if needed only for printing.
The customer is switching from Word based environment and they use cross references in the form "Figure X.Y". They would like Author view to as closely match final output as possible, including display of cross references. -- ------------------------------------------------------------------ Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz ------------------------------------------------------------------ Professional XML and Web consulting and training services DocBook/DITA customization, custom XSLT/XSL-FO document processing ------------------------------------------------------------------ Bringing you XML Prague conference http://xmlprague.cz ------------------------------------------------------------------
participants (2)
-
Cristi Talau
-
Jirka Kosek