Skip to main content

Specifying the Namespaces for Types

Specifying the Namespaces for Types

XML types are assigned to namespaces as follows:

  1. If the corresponding class definition defines the XSDTYPE class parameter, the type is in the following W3 namespace:

    http://www.w3.org/2001/XMLSchema
    

    You specify XSDTYPE only within data type classes.

    Note:

    A data type class does not inherit the XSDTYPE class parameter. That is, if you subclass an existing data type class, you must specify this parameter, if the class should be mapped to one of the XSD types.

  2. If the class definition does not define XSDTYPE but does define NAMESPACE, the type is in the namespace specified by NAMESPACE.

  3. Otherwise the type is not in any namespace.

    You can, however, specify a namespace when you generate a schema. See Generating XML Schemas from Classes.

To see the namespaces to which the types are assigned, you must use %XML.SchemaOpens in a new tab and %XML.WriterOpens in a new tab. For details, see Generating XML Schemas from Classes.

FeedbackOpens in a new tab