blob: e4595426373047ce396cdfeda074a4da19054999 [file] [log] [blame]
kprice159fa582006-05-08 21:30:45 +00001<?xml version="1.0" encoding="utf-8"?>
kpricede20a692008-04-24 00:27:47 +00002<!--Arbortext, Inc., 1988-2006, v.4002-->
kprice647b7352006-05-17 21:27:16 +00003<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
4 "task.dtd">
5<?Pub Inc?>
kprice159fa582006-05-08 21:30:45 +00006<task id="taddincl" xml:lang="en-us">
7<title>Adding include elements</title>
8<titlealts>
9<searchtitle>Adding include elements</searchtitle>
10</titlealts>
11<shortdesc>As schemas become larger, it is often desirable to divide their
12content among several schema documents for purposes such as ease of maintenance,
13reuse, and readability. You can use the <codeph>include</codeph> element to
kpricede20a692008-04-24 00:27:47 +000014bring in definitions and declarations from the included schema into the current
15schema. The included schema must be in the same target namespace as the including
16schema. </shortdesc>
kprice159fa582006-05-08 21:30:45 +000017<prolog><metadata>
kprice9623e9d2007-05-03 03:43:05 +000018<keywords><indexterm>XML schema editor<indexterm>include elements</indexterm></indexterm>
19<indexterm>XML schema files<indexterm>include elements</indexterm></indexterm>
kprice159fa582006-05-08 21:30:45 +000020</keywords>
21</metadata></prolog>
22<taskbody>
23<context><p>The following instructions were written for the XML perspective,
24but they will also work in many other perspectives.</p><p>To add an include
kpricede20a692008-04-24 00:27:47 +000025element, complete the following steps:</p></context>
kprice159fa582006-05-08 21:30:45 +000026<steps>
kpricede20a692008-04-24 00:27:47 +000027<step><cmd>Open your XML schema in the XML schema editor. In the Outline view,
28select your schema.</cmd><info>The entire schema and its contents are displayed
29in the Design view.</info></step>
kprice647b7352006-05-17 21:27:16 +000030<step><cmd>In the Design view, right-click in the <b>Directives</b> section
kprice159fa582006-05-08 21:30:45 +000031and click <uicontrol>Add Include</uicontrol>.</cmd></step>
kpricede20a692008-04-24 00:27:47 +000032<step><cmd>In the Properties view, click the <b>General</b> tab and click
33the <uicontrol>Browse</uicontrol> <image href="../images/Browse.gif"><alt>This
34graphic is the Browse button</alt></image> button to the right of the <uicontrol>Schema
35location</uicontrol> field.</cmd><info>The XML schema file you select must
36have the same namespace as the current schema.</info></step>
37<step><cmd>If you want to import an XML schema located in the workbench:</cmd>
38<substeps>
39<substep><cmd>Select <uicontrol>Workbench projects</uicontrol> and click <uicontrol>Next</uicontrol>. </cmd>
40</substep>
41<substep><cmd>Select the schema you want to import and click <uicontrol>Finish</uicontrol>.</cmd>
42</substep>
43</substeps>
kprice159fa582006-05-08 21:30:45 +000044</step>
kpricede20a692008-04-24 00:27:47 +000045<step><cmd>If you want to import an XML schema located on the Web:</cmd>
46<substeps>
47<substep><cmd>Select <uicontrol>HTTP</uicontrol> and click <uicontrol>Next</uicontrol>.</cmd>
48</substep>
49<substep><cmd>Type the URL of the XML schema and click <uicontrol>Finish</uicontrol>.</cmd>
50<info><note>A local copy of the schema will not be stored in the workbench.
kprice159fa582006-05-08 21:30:45 +000051Every time you validate your schema, the schema's contents will be checked
kpricede20a692008-04-24 00:27:47 +000052from the URL you specify.</note></info></substep>
53</substeps>
54</step>
kprice159fa582006-05-08 21:30:45 +000055<step><cmd>The XML schema editor will retrieve the location of the included
56XML schema file, and display it in the <uicontrol>Schema location</uicontrol> field.
57This field can be edited at any time to reflect the location of the XML schema
58file.</cmd></step>
59<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want
60to provide any information about this include element.</cmd><info>The <uicontrol>Documentation</uicontrol> page
kprice647b7352006-05-17 21:27:16 +000061is used for human readable material, such as a description.</info></step>
62<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to
63add application information elements to your annotations of schema components.</cmd>
64<info>The <uicontrol>Extensions</uicontrol> page allows you to specify the
65schema and add XML content to your annotations.</info></step>
kprice159fa582006-05-08 21:30:45 +000066</steps>
67<result><p>Once you have added the include element to your XML schema, when
68you define new elements, attributes, complex types, or simple types where
69you can specify type information, any declarations from the included schema
70will be available in the <uicontrol>Type</uicontrol> list for the element,
71attribute, complex or simple type.</p><p>For example, if Address.xsd has the
72following content:</p><codeblock>&lt;complexType name="Address">
73 &lt;sequence>
74 &lt;element name="name" type="string">
75 &lt;element name="street" type="string">
76 &lt;/sequence>
77&lt;/complexType>
78</codeblock>and you have an XML schema called PurchaseOrder.xsd that has added
79an include for Address.xsd, then when defining a new element in PurchaseOrder,
kpricede20a692008-04-24 00:27:47 +000080you can select Address as its type. <draft-comment>(c) Copyright 2001, World
81Wide Web Consortium (Massachusetts Institute of Technology, Institut National
82de Recherche en Informatique et en Automatique, Keio University).</draft-comment></result>
kprice159fa582006-05-08 21:30:45 +000083</taskbody>
kpricede20a692008-04-24 00:27:47 +000084</task><?Pub Caret?>
85<?Pub *0000004595?>