Polymorphism in xml ??

Discussion in 'Java' started by Sony Antony, Aug 26, 2003.

  1. Sony Antony

    Sony Antony Guest

    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
     
    Sony Antony, Aug 26, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Lawrence

    Polymorphism in GridView (ASP.Net 2.0)

    Kevin Lawrence, Feb 16, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    846
    Kevin Lawrence
    Feb 16, 2006
  2. Ian Mayo
    Replies:
    4
    Views:
    2,678
    Ian Mayo
    Jul 30, 2003
  3. Sony Antony

    Polymorphism in xml ??

    Sony Antony, Aug 26, 2003, in forum: XML
    Replies:
    0
    Views:
    1,012
    Sony Antony
    Aug 26, 2003
  4. Krivenok Dmitry
    Replies:
    13
    Views:
    1,442
    Axter
    Jun 1, 2006
  5. Erik Wasser
    Replies:
    5
    Views:
    463
    Peter J. Holzer
    Mar 5, 2006
Loading...

Share This Page