A subtype is always of type "supertype"
you asked "are you a super type", it says "yes, I am"
you didn't ask "are you this sub type", if you had, it would have said "yes, I am"
It is both - both times.
ops$tkyte%ORA10GR2> declare
2 x USR.MySubType := USR.MySubType( 'ABC' ) ;
3 y xmltype ;
4
5 begin
6 y := xmltype( x ) ;
7 if x is of ( USR.MySuperType ) then
8 DBMS_Output.Put_Line( 'MySuperType' ) ;
9 end if ;
10 if x is of ( USR.MySubType ) then
11 DBMS_Output.Put_Line( 'MySubType' ) ;
12 end if ;
13
14 x := NULL ;
15 DBMS_Output.Put_Line( y.getCLOBVal() ) ;
16
17 xmltype.toObject( y, x ) ;
18 if x is of ( USR.MySuperType ) then
19 DBMS_Output.Put_Line( 'MySuperType' ) ;
20 end if ;
21 if x is of ( USR.MySubType ) then
22 DBMS_Output.Put_Line( 'MySubType' ) ;
23 end if ;
24 end ;
25 /
MySuperType
MySubType
<MYSUBTYPE><MYATT>ABC</MYATT></MYSUBTYPE>
MySuperType
MySubType
PL/SQL procedure successfully completed.