Skip Headers

# Configuring XML Schema Namespace

Previous

Next

As defined in `http://www.w3.org/TR/REC-xml-names/`, an XML namespace is a collection of names, identified by a URI reference, which are used in XML documents as element types and attribute names. To promote reusability and modularity, XML document constructs should have universal names, whose scope extends beyond their containing document. XML namespaces are the mechanism which accomplishes this.

When you import an XML schema (see "Importing an XML Schema") such as the one that shows, TopLink Workbench organizes the various namespaces that the XML schema identifies as Table: TopLink Workbench XML Schema Categories shows.

XML Schema with Namespace Options

    <xsd:schema
        xmlns:<prefix>="<URI>"             <!-- TopLink Workbench Built-in Namespace -->
        targetNamespace="<URI>"            <!-- TopLink Workbench Target Namespace -->
        elementFormDefault="qualified"
        attributeFormDefault="unqualified"
        version="10.1.3">
        <xsd:import                        <!-- TopLink Workbench Imported Namespace -->
            namespace="http://xmlns.oracle.com/ias/xsds/opm"
            schemaLocation="object-persistence_1_0.xsd"
        />
    ...
    </xsd:schema>

TopLink Workbench XML Schema Categories

TopLink Workbench Category | Defined By | Purpose | When Needed
--- | --- | --- | ---
Built-in | `xmlns:<prefix>="<URI>"` | Provides access to types defined in other XML schemas for use as is. | If your project uses more than one XML schema or if you want to use `xsi` or `xsd` types.
Target | `targetNamespace="<URI>"` | The namespace you use to qualify the types you define for your application. If set, all XML documents that use these types must use this namespace qualifier. | You may need to specify a target namespace depending on how element and attribute form options are set (see "Element and Attribute Form Options").
Imported | `xsd:import` | Provides access to types defined in the corresponding built-in XML schema so that you can extend the built-in types. Extended types must be qualified by the target namespace. | If your project uses more than one XML schema and you want to extend one or more built-in types.

For more information, see "Understanding XML Namespaces".