<fragref>
A fragment reference is the mechanism for referencing a syntax fragment within the same syntax diagram.
Usage information
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.
Specialization hierarchy
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.
Content model
(Text | <keyword> | <ph> | <q> | <term> | <text> | <tm> | <data> | <draft-comment> | <foreign> | <required-cleanup>)*
Contained by
<fragment>, <groupchoice>, <groupcomp>, <groupseq>, <synblk>, <syntaxdiagram>
- Text
<data><draft-comment><foreign><keyword><ph><q><required-cleanup><term><text><tm>
Contained by
Inheritance
+ topic/xref pr-d/xref syntaxdiagram-d/fragref
The <fragref> element is specialized from <xref>. It is defined in the syntaxdiagram-domain module.
Attributes
The following attributes are available on this element: universal
attributes and @href.
- The
@hrefattribute is a reference to a syntax diagram<fragment>. The referenced<fragment>must be in the same diagram as the<fragref>element. - The
@importanceattribute 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.
@href(link-relationship attributes)- Specifies a reference to a resource. See STUB CONTENT for detailed information on supported values and processing implications.
@importance- The
@importanceattribute 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>