Table of Contents

The <importNCL> Element

Definition and Usage

The <importNCL> element allows for incorporating another NCL document specification. As a consequence, all bases defined inside the imported NCL document, as well as the document <body> element, are imported, all at once. The bases will be treated as if each one is imported by <importBase> elements. The imported <body> element will be treated as a <context> element. It should be stressed that the <importNCL> element does not “include” the referred NCL document but only makes the referred document visible to have its components reused by the document that has defined the <importNCL> element. Thus, the imported <body>, as well as any of its contained nodes, may be reused inside the <body> element of the importing NCL document.

The documentURI attribute of the <importNCL> element refers to a URI corresponding to the NCL document to be imported. The alias attribute specifies a name to be used as prefix when referring to elements of this imported document. The reference must have the format: alias#element_id. It is important to note that the same alias should be used when referring to elements defined in the indirectly imported document bases (<regionBase>, <connectorBase>, <descriptorBase>, etc.).

The import operation is transitive, that is, if baseA imports baseB that imports baseC, then baseA imports baseC. However, the alias defined for baseC inside baseBis not considered by baseA.

Syntax

Element Attributes Content Parent
<importNCL> alias, documentURI <importedDocumentBase>

Attributes

Name Value Description
alias It may receive any string value that begins with a letter or an underscore and that only contains letters, digits, “.”, and “_”. The alias attribute specifies a name to be used as prefix when referring to elements of the imported base. The alias value must be unique in a document ands its scope is constrained to the document that has defined the alias attribute.
documentURI URI. The documentURI attribute is the locator for the NCL document from where the base or document will be imported.