History | Edit

You can use this function on the CSS content property to obtain a text description from the source of a reference.

By default, the oxy_link-text() function resolves DITA and DocBook references. For further details about how you can also extend this functionality to other frameworks, go to Configuring an Extensions Bundle.

For the following XML and associated CSS fragments the oxy_link-text() function is resolved to the value of the xreflabel attribute.

<para><code id="para.id" xreflabel="The reference label">my code</code>
      </para>
<para><xref linkend="para.id"/></para>
xref {
    content: oxy_link-text();
}

If the text from the target cannot extracted (for instance, if the href is not valid), you can use an optional argument to display fallback text.

*[class~="map/topicref"]:before{
    content: oxy_link-text("Cannot find the topic reference");
    link:attr(href);
}