Skip Headers

# Configuring for Complex Type of anyType

Previous

Next

This attribute applies only to TopLink Workbench. Use this option to solve "No schema context is specified" problems (see "Using the Problems Window") for an XML descriptor that does not represent an element in your XML schema.

In general, TopLink Workbench assumes that every XML descriptor must have a schema context (see "Configuring Schema Context for an XML Descriptor"). However, if a class in your project does not relate to an element in your schema, then it does not have a schema context.

For example, consider the schema that Example: Schema Using xsd:anyType shows.

Schema Using xsd:anyType

    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <xsd:element name="customer" type="customer-type"/>
        <xsd:complexType name="customer-type">
            <xsd:sequence>
                <xsd:element name="contact-method" type="xsd:anyType"/>
            </xsd:sequence>
        </xsd:complexType>
        <xsd:element name="address">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="street" type="xsd:string"/>
                    <xsd:element name="city" type="xsd:string"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="phone-number" type="xsd:string"/>
    </xsd:schema>

Because element `contact-method` is of type `xsd:anyType`, your project requires a class to represent that type, such as class `AnyTypeImpl` shown in Figure: Class Representing xsd:anyType. Because this class does not relate to any complex type in your schema, it has no schema context. In this example, you would select this option for the `AnyTypeImpl` class.

Class Representing xsd:anyType

Description of "Class Representing xsd:anyType"

Note: See also "Configuring Maps to Wildcard".

For more information, see "xs:any and xs:anyType Support".