In my XML schema file, I have a list element that is defined as follows:

    <complexType name="PhoneNumberListType">
        <complexContent>
            <restriction base="ab:IDObjectListType">
                <sequence>
                    <element ref="ab:PhoneNumber" minOccurs="0"
maxOccurs="unbounded"/>
                </sequence>
                <attribute name="primary" type="string"/>
            </restriction>
        </complexContent>
    </complexType>

In the above, the IDObjectListType is just a generic list type definition,
and it works fine in other elements so I don't think it is related to the
problem. I will provide more information on it if you think it is pertinent
to this problem.

So basically, this element contains 0 or more PhoneNumber elements. Here's
where it gets interesting. The PhoneNumber element is an abstract, with a
specific "subtype" called USPhoneNumber. These elements are declared later
in the schema as follows:

    <element name="PhoneNumber" type="ab:PhoneNumberType" abstract="true"/>
    <element name="USPhoneNumber" substitutionGroup="ab:PhoneNumber"
type="ab:USPhoneNumberType"/>

So basically, I have an element that contains a list of phone numbers, where
a phone number is either a US phone number or some other phone number (to be
defined later). This section of my schema works both under Xerces 1.4.4 and
Xerces 2.0.1.

When I look at an instance document that should be valid against this
schema, I have an element that looks like:

            <PhoneNumberList primary="Home">
                <USPhoneNumber id="Home">
                    <AreaCode>111</AreaCode>
                    <Exchange>111</Exchange>
                    <Suffix>1111</Suffix>
                </USPhoneNumber>
            </PhoneNumberList>

This element should be valid against the schema. However, the opening
"USPhoneNumber" element is marked in red. The IDEA status line says "Element
USPhoneNumber is not allowed here".

It appears to me that IDEA is not recognizing extensions of abstract
elements that use the substitutionGroup attribute to identify their
"super-type".

- Tim




_______________________________________________
Eap-list mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-list

Reply via email to