blob: ebe7557d4c72984cc365f8ec5e449711c13f8c0e [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="taddimpt" xml:lang="en-us">
7<title>Adding import elements</title>
8<titlealts>
9<searchtitle>Adding import 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 an <codeph>import</codeph> element to
14bring in definitions and declarations from an imported schema into the current
15schema. </shortdesc>
16<prolog><metadata>
kprice9623e9d2007-05-03 03:43:05 +000017<keywords><indexterm>XML schema editor<indexterm>import elements</indexterm></indexterm>
18<indexterm>XML schema files<indexterm>import elements</indexterm></indexterm>
kprice159fa582006-05-08 21:30:45 +000019</keywords>
20</metadata></prolog>
21<taskbody>
22<context><p>The imported schema can come from a different namespace than the
kpricede20a692008-04-24 00:27:47 +000023current schema does. You can add multiple import elements to an XML schema,
24however, prefixes and namespaces have to unique amongst the imported schemas.</p><p>The
25following instructions were written for the Resource perspective, but they
26will also work in many other perspectives.</p><p>To add an import element,
27complete the following steps:</p></context>
kprice159fa582006-05-08 21:30:45 +000028<steps>
kpricede20a692008-04-24 00:27:47 +000029<step><cmd>Open your XML schema in the XML schema editor. In the Outline view,
30select your schema.</cmd><info>The entire schema and its contents should be
31displayed in the Design view.</info></step>
kprice647b7352006-05-17 21:27:16 +000032<step><cmd>In the Design view, right click in the <b>Directives</b> section
kprice159fa582006-05-08 21:30:45 +000033and click <uicontrol>Add Import</uicontrol>.</cmd></step>
kpricede20a692008-04-24 00:27:47 +000034<step><cmd>In the Properties view, click the <b>General</b> tab and click
35the <uicontrol>Browse</uicontrol> <image href="../images/Browse.gif"><alt>This
36graphic is the Browse button</alt></image> button to the right of the <uicontrol>Schema
37location</uicontrol> field.</cmd></step>
kprice647b7352006-05-17 21:27:16 +000038<step><cmd>If you want to import an XML schema located in the workbench:</cmd>
kprice159fa582006-05-08 21:30:45 +000039<substeps>
kprice647b7352006-05-17 21:27:16 +000040<substep><cmd>Select <uicontrol>Workbench projects</uicontrol> and click <uicontrol>Next</uicontrol>. </cmd>
41</substep>
kprice159fa582006-05-08 21:30:45 +000042<substep><cmd>Select the schema you want to import and click <uicontrol>Finish</uicontrol>.</cmd>
43</substep>
44</substeps>
45</step>
kprice9623e9d2007-05-03 03:43:05 +000046<step><cmd>If you want to import an XML schema located on the Web:</cmd>
kprice159fa582006-05-08 21:30:45 +000047<substeps>
kprice647b7352006-05-17 21:27:16 +000048<substep><cmd>Select <uicontrol>HTTP</uicontrol> and click <uicontrol>Next</uicontrol>.</cmd>
49</substep>
kprice159fa582006-05-08 21:30:45 +000050<substep><cmd>Type the URL of the XML schema and click <uicontrol>Finish</uicontrol>.</cmd>
51<info><note>A local copy of the schema will not be stored in the workbench.
52Every time you validate your schema, the schema's contents will be checked
53from the URL you specify.</note></info></substep>
54</substeps>
55</step>
56<step><cmd>The XML schema editor will retrieve the namespace for the imported
57XML schema file and display it as read-only in the <uicontrol>Namespace</uicontrol> field.</cmd>
58</step>
59<step><cmd>If necessary, type a unique prefix for this namespace in the <uicontrol>Prefix</uicontrol> field.</cmd>
60</step>
61<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want
62to provide any information about this import element.</cmd><info>The <uicontrol>Documentation</uicontrol> page
kprice647b7352006-05-17 21:27:16 +000063is used for human readable material, such as a description.</info></step>
64<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to
65add application information elements to your annotations of schema components.</cmd>
66<info>The <uicontrol>Extensions</uicontrol> page allows you to specify the
67schema and add XML content to your annotations.</info></step>
kprice159fa582006-05-08 21:30:45 +000068</steps>
69<result><p>Once you have added an import element to your XML schema, when
70you define new elements, attributes, complex types, or simple types where
kpricede20a692008-04-24 00:27:47 +000071you can specify type information, any declarations from the included s<?Pub Caret?>chema
kprice159fa582006-05-08 21:30:45 +000072will be available in the <uicontrol>Type</uicontrol> list for the element,
73attribute, complex or simple type.</p></result>
74<postreq></postreq>
75</taskbody>
76</task>
kpricede20a692008-04-24 00:27:47 +000077<?Pub *0000004058?>