Hello,

as I know with XMLBeans you can write simply

final Shape shape = Shape.Factory.parse(someShapteInput);
if(shape instanceof Circle) {
  final Circle = (Circle) shape;
  // do whatever you want with a circle
} else if(shape instanceof Square) {
  final Square square = (Square)shape;
  // do whatever you want with a square
}

Good luck!

regards,

Siamak Haschemi
Berlin
Germany


-------- Original-Nachricht --------
Datum: Wed, 28 Jun 2006 15:10:18 -0700
Von: Cezar Andrei <[EMAIL PROTECTED]>
An: [email protected]
Betreff: RE: AbstractTypes problem

> You can always check the type field of your xmlobject.
> 
> XmlObject xo = ....;
> SchemaType instanceType = xo.type;
> 
> 
> 
> > -----Original Message-----
> > From: Alex Soto [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, June 28, 2006 9:40 AM
> > To: [email protected]
> > Subject: AbstractTypes problem
> > 
> > Hello i don't know how to develop the next problem:
> > 
> > I have an Abstract DataType call it Shape and two extensions Circle and
> > Square.
> > 
> > Then i have an XML file with circles and squares, with tag <Shape
> > xsi:type="CircleType" ..../> and <Shape xsi:type="SquareType".../>
> > 
> > First of all i read all circles and squares but of course using
> > Shape.Factory.parse so a Shape is returned. Now i wanted to know if what
> > i have is a CircleType or SquareType.
> > 
> > Is any function in XML Beans to know it?
> > 
> > Thank you very much.
> > 
> > 
> > La información contenida en el presente e-mail es confidencial y está
> > reservada para el uso exclusivo de su destinatario. Se prohíbe
> > estrictamente la distribución, copia o utilización de esta
> información sin
> > el previo permiso de su destinatario. Si usted no fuera el destinatario,
> > por favor notifíquelo inmediatamente al remitente y elimine el presente
> > mensaje de su sistema informático.
> > 
> > Information contained in this e-mail is confidential and is intended for
> > the use of the addressee only. Any dissemination, distribution, copying
> or
> > use of this communication without prior permission of the addressee is
> > strictly prohibited. If you are not the intended addressee, please
> notify
> > the sender immediately by reply and then delete this message from your
> > computer system.
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> 
> _______________________________________________________________________
> Notice:  This email message, together with any attachments, may contain
> information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
> entities,  that may be confidential,  proprietary,  copyrighted  and/or
> legally privileged, and is intended solely for the use of the individual
> or entity named in this message. If you are not the intended recipient,
> and have received this message in error, please immediately return this
> by email and then delete it.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 


Echte DSL-Flatrate dauerhaft für 0,- Euro*!
"Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to