XML Schema Question

  • Thread starter Matthew Harrison
  • Start date
M

Matthew Harrison

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.
 
B

Boris Kolpackov

Hi Matthew,

Matthew Harrison said:
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
 
M

Matthew Harrison

Boris said:
Hi Matthew,



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>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top