###### 3.2.6.2.3 coderef

The <coderef> element references an external file that contains literal code. When evaluated, the <coderef> element should cause the target code to be displayed inline. If the target contains non-XML characters such as '<' or '&', those will need to be handled in a way that they may be displayed correctly by the final rendering engine. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts, and reference information.

###### Contains

Doctype | Content model
topic (technical content), map (technical content), concept, ditabase, glossary, glossentry, glossgroup, reference, task, bookmap | no content

###### Contained by

Doctype | Content model
topic (technical content), map (technical content), concept, ditabase, glossary, glossentry, glossgroup, reference, task (strict), task (general), bookmap | codeblock

###### Inheritance

- topic/xref pr-d/coderef

###### Example

    <example>
      <title>Processing DITA</title>
      <p>This code is an example of how to process DITA.</p>
      <codeblock><coderef href="process-dita.xsl"/></codeblock>
    </example>

###### Attributes

Name | Description | Data Type | Default Value | Required?
href | Provides a reference to a resource. See 3.4.2.1 The href attribute for detailed information on supported values and processing implications. | CDATA | #IMPLIED | No
type | Describes the target of a reference. See 3.4.2.8 The type attribute for detailed information on supported values and processing implications. | CDATA | #IMPLIED | No
format | The format attribute identifies the format of the resource being referenced. See 3.4.2.9 The format attribute for details on supported values. | CDATA | #IMPLIED | No
scope | The scope attribute identifies the closeness of the relationship between the current document and the target resource. See 3.4.2.10 The scope attribute for more information on values. | (local | peer | external | -dita-use-​conref-​target) | #IMPLIED | No
univ-atts attribute group (includes select-atts, id-atts, and localization-atts groups) | A set of related attributes, described in 3.4.1.3 univ-atts attribute group |  |  |
global-atts attribute group (xtrf, xtrc) | A set of related attributes, described in 3.4.1.2 global-atts attribute group |  |  |
class, outputclass, keyref | Class and outputclass are described in 3.4.1.9 Other common DITA attributes |  |  |

Previous Topic: 3.2.6.2.2 codeblock

Next Topic: 3.2.6.2.4 codeph

Parent Topic: 3.2.6.2 Programming elements

Sibling Topics:

3.2.6.2.1 apiname

3.2.6.2.2 codeblock

3.2.6.2.4 codeph

3.2.6.2.5 option

3.2.6.2.6 parmname

3.2.6.2.7 parml

3.2.6.2.8 plentry

3.2.6.2.9 pt

3.2.6.2.10 pd

3.2.6.2.11 synph

3.2.6.2.12 syntaxdiagram

3.2.6.2.13 groupseq

3.2.6.2.14 groupchoice

3.2.6.2.15 groupcomp

3.2.6.2.16 fragment

3.2.6.2.17 fragref

3.2.6.2.18 synblk

3.2.6.2.19 synnote

3.2.6.2.20 synnoteref

3.2.6.2.21 kwd

3.2.6.2.22 var

3.2.6.2.23 oper

3.2.6.2.24 delim

3.2.6.2.25 sep

3.2.6.2.26 repsep