<fragref>

A fragment reference is the mechanism for referencing a syntax fragment within the same syntax diagram.

The <fragref> element is used to reference a syntax fragment multiple times or pull a large section of syntax out of line for easier reading.

The <fragref> element is specialized from <xref>. It is defined in the syntax-diagram domain module, which is a specialization of the programming domain module.

(Text | <keyword> | <ph> | <q> | <term> | <text> | <tm> | <data> | <draft-comment> | <foreign> | <required-cleanup>)*

Contained by

<fragment>, <groupchoice>, <groupcomp>, <groupseq>, <synblk>, <syntaxdiagram>

Zero or more of the following
  • Text
  • <data>
  • <draft-comment>
  • <foreign>
  • <keyword>
  • <ph>
  • <q>
  • <required-cleanup>
  • <term>
  • <text>
  • <tm>

Contained by

+ topic/xref pr-d/xref syntaxdiagram-d/fragref

The <fragref> element is specialized from <xref>. It is defined in the syntaxdiagram-domain module.

The following attributes are available on this element: universal attributes and @href.

For this element:
  • The @href attribute is a reference to a syntax diagram <fragment>. The referenced <fragment> must be in the same diagram as the <fragref> element.
  • The @importance attribute is limited to the values optional, required, or -dita-use-conref-target.

The following attributes are available on this element: universal attributes and the attributes defined below.

Specifies a reference to a resource. See STUB CONTENT for detailed information on supported values and processing implications.
The @href attribute is a reference to a syntax diagram <fragment>. The referenced <fragment> must be in the same diagram as the <fragref> element.
@importance
The @importance attribute is limited to the values optional, required, or -dita-use-conref-target.

Example

This section is non-normative.

The following code sample shows how the <fragref> element can be used to break out a set of related logging options from the larger set of syntax. The <fragref> element is part of the program sequence after an input file, but the syntax for logging is defined outside of the main diagram.

<syntaxdiagram frame="none">
  <title>CopyFile</title>
  <groupseq><kwd>COPYF</kwd></groupseq>
  <groupcomp><var>input-filename</var><kwd>*INFILE</kwd></groupcomp>
  <groupseq><var>output-filename</var><kwd>*OUTFILE</kwd></groupseq>
  <fragref href="#./overlay"/>
  <groupchoice><var>input-filename</var><kwd>*INFILE</kwd></groupchoice>
  <groupchoice><var>output-filename</var><kwd>*OUTFILE</kwd></groupchoice>
  <fragment id="overlay">
    <title>Overlay</title>
    <groupchoice><kwd>*OVERLAP</kwd><kwd>*Prompt</kwd></groupchoice>
  </fragment>
</syntaxdiagram>