> H Wei (or is it Chiang),
>
        Well, Wei is better :-)

> An extension may not be part of the same namespace as it's base. The
> xmlName is certainly different, couse it is Y instead of X. I Hope
> that answer it.
>

Although I can not see how this information in the super class is used, I
accept that it could be useful during marshalling/unmarshalling.  Thanks for
the explanation.

I would also like to bring up a question posted in an earlier mail on a
different topic (JavaNaming). This time I'll ask the question in a different
way:

Suppose the xsd is:

...
<xsd:complexType name="top" abstract ="true">
        <xsd:sequence min occurs="0" maxOccurs="unbounded">
                <xsd:element name="text" type="xsd:string">
                <xsd:element name="price" type="xsd:decimal">
        </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="derived">
        <xsd:complexContent>
                <xsd:extension base="top">
                <xsd:sequence min occurs="0" maxOccurs="unbounded">
                        <xsd:element name="discount" type="xsd:decimal">
                </xsd:sequence>
        </xsd:complexContent>
</xsd:complexType>

<xsd:element name="Store">
        <xsd;complexType>
                <xsd:sequence>
                        <xsd:element name="item" maxOccurs="unbounded" type="top">
                </xsd:sequence>
        </xsd:complexType>
</sxd:complexType>

Suppose one xml based on the above xsd is:
...
<Store ...>
        <item xsi:type="derived">
                <text>BottleOfJellyBeans</text>
                <price>1</text>
        </item>
        <item xsd:type="derived">
                <text>Jam</text>
                <price>3</text>
                <discount>0.20</discount>
        </item>
</Store>

I would expect that instances of "derived" class will be instantiated when
the above xml is being unmarshalled.  However, the unmarshal code actually
instantiates a "top" class.  Do I miss something here?

Thanks,
Wei

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to