XML Schema Question

Discussion in 'XML' started by Matthew Harrison, Aug 6, 2007.

  1. I am defining an abstract conversation class in XML Schema (using XMLSpy).

    The basics are:

    Conversation (attr:Reference)
    --> Identity (1)
    --> Id
    --> Client
    --> Sequence (atrr:Index) (1..n)
    --> Sender
    --> Timestamp

    Now I want to define a descendant called

    BlahConversation based on Conversation

    However, I need to include additional fields in Sequence (status
    information specific to the Blah type).

    How do I correctly structure things, such that I don't end up having to
    define the whole structure fully for each different conversation subtype ?

    Thanks.

    --
    Pinging self [127.0.0.1] with 32 bites of banana cake:

    Ping statistics for 127.0.0.1:
    Slices: Sent = 4, Received = 0, Lost = 4 (100% loss),
    Matthew Harrison, Aug 6, 2007
    #1
    1. Advertising

  2. Hi Matthew,

    Matthew Harrison <> writes:

    > Conversation (attr:Reference)
    > --> Identity (1)
    > --> Id
    > --> Client
    > --> Sequence (atrr:Index) (1..n)
    > --> Sender
    > --> Timestamp


    This can be interpreted in many different ways. Shows us the XML
    documents that correspond to BlahConversation and Conversation.

    -boris

    --
    Boris Kolpackov
    Code Synthesis Tools CC
    http://www.codesynthesis.com
    Open-Source, Cross-Platform C++ XML Data Binding
    Boris Kolpackov, Aug 7, 2007
    #2
    1. Advertising

  3. Re: XML Schema Question (extend from abstract 'class').

    Boris Kolpackov wrote:
    > Hi Matthew,
    >
    > Matthew Harrison <> writes:
    >
    >> Conversation (attr:Reference)
    >> --> Identity (1)
    >> --> Id
    >> --> Client
    >> --> Sequence (atrr:Index) (1..n)
    >> --> Sender
    >> --> Timestamp

    >
    > This can be interpreted in many different ways. Shows us the XML
    > documents that correspond to BlahConversation and Conversation.
    >
    > -boris
    >


    Conversation would never have a document defined against it (it's an
    abstract 'class'):

    However, here is two sample XML documents which are descendants, I want
    them both to adhere to the Conversation schema in addition having
    further definitions in either the Identity or Sequence sections, or
    both. For example the MsgConversation has a MsgText, the
    BlahConversation has a BlahInfo.

    <?xml version="1.0" encoding="UTF-8"?>
    <MsgConversation Reference="AAAA1234567890">
    <Idenity>
    <Id>0</Id>
    <Remote>AA40019</Remote>
    <Client>47</Client>
    <Module>Msg</Module>
    </Idenity>
    <Sequence Index="1">
    <Sender>remote</Sender>
    <TimeStamp>2001-12-17T09:30:47.0Z</TimeStamp>
    <MsgText>Blah Blah Blah</MsgText>
    </Sequence>
    <Sequence Index="2">
    <Sender>client</Sender>
    <TimeStamp>2001-12-17T09:30:47.0Z</TimeStamp>
    <MsgText>Blah Blah Blah</MsgText>
    </Sequence>
    </MsgConversation>



    <?xml version="1.0" encoding="UTF-8"?>
    <BlahConversation Reference="AAAA1234567892">
    <Idenity>
    <Id>0</Id>
    <Remote>AA40029</Remote>
    <Client>44</Client>
    <Module>Blah</Module>
    </Idenity>
    <Sequence Index="1">
    <Sender>remote</Sender>
    <TimeStamp>2001-12-17T09:30:47.0Z</TimeStamp>
    <BlahInfo>01100010</BlahInfo>
    </Sequence>
    <Sequence Index="2">
    <Sender>client</Sender>
    <TimeStamp>2001-12-17T09:30:47.0Z</TimeStamp>
    <BlahInfo>01101011</BlahInfo>
    </Sequence>
    </BlahConversation>




    --
    Pinging self [127.0.0.1] with 32 bites of banana cake:

    Ping statistics for 127.0.0.1:
    Slices: Sent = 4, Received = 0, Lost = 4 (100% loss),
    Matthew Harrison, Aug 7, 2007
    #3
    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. Markus
    Replies:
    1
    Views:
    1,522
    Markus
    Nov 23, 2005
  2. Fred Smith
    Replies:
    1
    Views:
    938
    Martin Honnen
    Feb 5, 2004
  3. Hari Om
    Replies:
    1
    Views:
    461
    Martin SChukrazy
    Mar 2, 2004
  4. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,244
    Stanimir Stamenkov
    Apr 25, 2005
  5. Replies:
    3
    Views:
    2,830
Loading...

Share This Page