AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Polymorphism in xml ??

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help
View previous topic :: View next topic  
Author Message
Sony Antony
Guest





PostPosted: Tue Aug 26, 2003 3:37 pm    Post subject: Polymorphism in xml ?? Reply with quote



We have an xml/java/W3C schema/jaxb based application.
I would like to define some elements that are extensible. In
particular the schema has an element defined as 'exception'. This has
an integer field 'errorcode' and 'reason'. But I would like to allow
the XML to send additional fields, if the particular exception
demands it ( 'status' for ex. )
Is there any way to do this without violating the schema.
If there is what will happen when I unmarshal using jaxb. ( since the
generated classes does not know about these extra fields )

I read about substitutionGroup s in xml. But it does not allow you to
add an additional field. Also it requires the substituting/derived
element to have the same type as the original.

All the examples I saw for substitutiongroup were with a single field
of type xs:string. Is it possible to use this for an element
containing multiple elements. Is there an example for this out there.
Thanks in advance.
--sony
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.