s.xref

Table of Contents

Syntax #

s.xref

Purpose #

The s.xref annotation is used to tag a span or paragraph element as being a cross reference to another location within a topic. This can refer to something in the same or another topic, or a completely external source.

 

This annotation can be applied on its own. In this scenario, the content tagged will become an xref element with an external scope and the content as the href.

 

This annotation can also be applied in conjunction with the annotation set-attribute(href=\{variable}). In this scenario, the content tagged will become an xref with an external scope, and will assign {variable} as the href.

 

This annotation is not required to be applied to an existing link in the source document. Migrate will automatically apply <xref> tags to any span with an internal or external hyperlink. Applying this annotation to an existing hyperlink will cause an <xref> tag to be nested as a <ph> element inside the automatically generated tags.

Example #

The following is an example of a time when you might want to use the annotation

 

The following is an example of a rule that will apply the annotation

The following is the DITA XML output for the rule:

For an element where the href is not specified:

<p>This sentence contains a <xref href=”cross%20reference” scope=”external”>cross reference</xref> to an external document.</p>

 

For an element where the href is applied manually:

<p>This sentence contains a <xref href=”www.stilo.com” scope=”external”>cross reference</xref> to www.stilo.com.</p>