Skip to main content



      Home
Home » Archived » XML Schema Definition (XSD) » How to create schema with any number of elements(0-n) and in any order?
How to create schema with any number of elements(0-n) and in any order? [message #50025] Wed, 11 August 2004 13:12 Go to next message
Eclipse UserFriend
Originally posted by: susil.bravobrava.com

Hello All,

I am working in an existing xml that has the following syntax:

1. element "actions" can have following elements more than once or not
at all:
: Sub elements "record", "say", "listen", "play","explain" as in xml
sample below
2. These sub elements could be in any order

Initially I thought of using all but it does not allow more than one
itration.

What could be the xml schema definition for these?

Any help will be highly appreciated.

Thanks
Su

--------- Sample XML ------------------------------
Sample Xml:
<?xml version="1.0" encoding="utf-8"?>
<historySubmit sessionId="17A5C33539093BEB3B74E0FEEE476240" Version="1.0">
<sessions storyId="B5BB0DCB31F10C31E4DCC88ECF30F4EB" version="1.0">
<session start="2004-08-09 16:22:01" duration="00:03:21.122">
<properties>
<type>PRACTICE</type>
<software>SpeaK!</software>
</properties>
<actions>
<record start="00:00:10.083" wordId="0"
filename="20040809_162211.spx">
<w id="0" start="0" duration="540" result="MEDIUM" />
<w id="1" start="540" duration="440" result="FORCED" />
</record>
<record start="00:00:12.281" wordId="2"
filename="20040809_162213.spx" auto="True">
<w id="2" start="0" duration="580" result="BAD" />
<w id="3" start="580" duration="480" result="BAD" />
<w id="4" start="1230" duration="910" result="MEDIUM" />
<w id="5" start="2470" duration="210" result="FORCED" />
<w id="6" start="2680" duration="500" result="MEDIUM" />
<w id="7" start="3850" duration="370" result="MEDIUM" />
<w id="8" start="4340" duration="520" result="GOOD" />
<w id="9" start="4890" duration="370" result="BAD" />
<w id="10" start="5260" duration="210" result="FORCED" />
<w id="11" start="5470" duration="260" result="MEDIUM" />
<w id="11" start="5980" duration="330" result="MEDIUM" />
<w id="12" start="7340" duration="600" result="BAD" />
<w id="13" start="8530" duration="450" result="FORCED" />
</record>
<record start="00:00:22.130" wordId="14"
filename="20040809_162223.spx" auto="True">
<w id="14" start="0" duration="500" result="FORCED" />
</record>
<record start="00:00:24.141" wordId="15"
filename="20040809_162225.spx" auto="True">
<w id="15" start="0" duration="1020" result="MEDIUM" />
<w id="16" start="1020" duration="610" result="MEDIUM" />
<w id="17" start="1670" duration="450" result="MEDIUM" />
<w id="18" start="2480" duration="360" result="MEDIUM" />
<w id="19" start="2840" duration="410" result="MEDIUM" />
<w id="20" start="3250" duration="160" result="GOOD" />
<w id="21" start="3510" duration="190" result="FORCED" />
<w id="22" start="3700" duration="280" result="GOOD" />
<w id="23" start="4010" duration="480" result="MEDIUM" />
</record>
<play start="00:00:31.154" startId="24" stopId="26" />
<say start="00:00:33.601" wordId="36" />
<say start="00:00:34.629" wordId="37" />
<explain start="00:00:35.596" wordId="37" />
<play start="00:00:36.671" startId="37" stopId="40" />
<record start="00:00:40.069" wordId="40"
filename="20040809_162241.spx">
<w id="40" start="0" duration="970" result="MEDIUM" />
</record>
</actions>
</session>
<session start="2004-08-09 16:31:12" duration="00:00:19.872">
<properties>
<type>PRACTICE</type>
<software>SpeaK!</software>
</properties>
</session>
<session start="2004-08-09 16:41:52" duration="00:00:27.915">
<properties>
<type>PRACTICE</type>
<software>SpeaK!</software>
</properties>
<actions>
<record start="00:00:23.364" wordId="37"
filename="20040809_164216.spx" />
<say start="00:00:25.702" wordId="37" />
</actions>
</session>
</sessions>
</historySubmit>
Re: How to create schema with any number of elements(0-n) and in any order? [message #50087 is a reply to message #50025] Wed, 11 August 2004 13:36 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Su,

A <choice> with minOccurs="0" and maxOccurs="unbounded" of the
subelements will validate any combination of zero or more subelements.


exquisitus wrote:

> Hello All,
>
> I am working in an existing xml that has the following syntax:
>
> 1. element "actions" can have following elements more than once or not
> at all:
> : Sub elements "record", "say", "listen", "play","explain" as in xml
> sample below
> 2. These sub elements could be in any order
>
> Initially I thought of using all but it does not allow more than one
> itration.
>
> What could be the xml schema definition for these?
>
> Any help will be highly appreciated.
>
> Thanks
> Su
>
> --------- Sample XML ------------------------------
> Sample Xml:
> <?xml version="1.0" encoding="utf-8"?>
> <historySubmit sessionId="17A5C33539093BEB3B74E0FEEE476240"
> Version="1.0">
> <sessions storyId="B5BB0DCB31F10C31E4DCC88ECF30F4EB" version="1.0">
> <session start="2004-08-09 16:22:01" duration="00:03:21.122">
> <properties>
> <type>PRACTICE</type>
> <software>SpeaK!</software>
> </properties>
> <actions>
> <record start="00:00:10.083" wordId="0"
> filename="20040809_162211.spx">
> <w id="0" start="0" duration="540" result="MEDIUM" />
> <w id="1" start="540" duration="440" result="FORCED" />
> </record>
> <record start="00:00:12.281" wordId="2"
> filename="20040809_162213.spx" auto="True">
> <w id="2" start="0" duration="580" result="BAD" />
> <w id="3" start="580" duration="480" result="BAD" />
> <w id="4" start="1230" duration="910" result="MEDIUM" />
> <w id="5" start="2470" duration="210" result="FORCED" />
> <w id="6" start="2680" duration="500" result="MEDIUM" />
> <w id="7" start="3850" duration="370" result="MEDIUM" />
> <w id="8" start="4340" duration="520" result="GOOD" />
> <w id="9" start="4890" duration="370" result="BAD" />
> <w id="10" start="5260" duration="210" result="FORCED" />
> <w id="11" start="5470" duration="260" result="MEDIUM" />
> <w id="11" start="5980" duration="330" result="MEDIUM" />
> <w id="12" start="7340" duration="600" result="BAD" />
> <w id="13" start="8530" duration="450" result="FORCED" />
> </record>
> <record start="00:00:22.130" wordId="14"
> filename="20040809_162223.spx" auto="True">
> <w id="14" start="0" duration="500" result="FORCED" />
> </record>
> <record start="00:00:24.141" wordId="15"
> filename="20040809_162225.spx" auto="True">
> <w id="15" start="0" duration="1020" result="MEDIUM" />
> <w id="16" start="1020" duration="610" result="MEDIUM" />
> <w id="17" start="1670" duration="450" result="MEDIUM" />
> <w id="18" start="2480" duration="360" result="MEDIUM" />
> <w id="19" start="2840" duration="410" result="MEDIUM" />
> <w id="20" start="3250" duration="160" result="GOOD" />
> <w id="21" start="3510" duration="190" result="FORCED" />
> <w id="22" start="3700" duration="280" result="GOOD" />
> <w id="23" start="4010" duration="480" result="MEDIUM" />
> </record>
> <play start="00:00:31.154" startId="24" stopId="26" />
> <say start="00:00:33.601" wordId="36" />
> <say start="00:00:34.629" wordId="37" />
> <explain start="00:00:35.596" wordId="37" />
> <play start="00:00:36.671" startId="37" stopId="40" />
> <record start="00:00:40.069" wordId="40"
> filename="20040809_162241.spx">
> <w id="40" start="0" duration="970" result="MEDIUM" />
> </record>
> </actions>
> </session>
> <session start="2004-08-09 16:31:12" duration="00:00:19.872">
> <properties>
> <type>PRACTICE</type>
> <software>SpeaK!</software>
> </properties>
> </session>
> <session start="2004-08-09 16:41:52" duration="00:00:27.915">
> <properties>
> <type>PRACTICE</type>
> <software>SpeaK!</software>
> </properties>
> <actions>
> <record start="00:00:23.364" wordId="37"
> filename="20040809_164216.spx" />
> <say start="00:00:25.702" wordId="37" />
> </actions>
> </session>
> </sessions>
> </historySubmit>
>
Re: How to create schema with any number of elements(0-n) and in any order? [message #590102 is a reply to message #50025] Wed, 11 August 2004 13:36 Go to previous message
Eclipse UserFriend
Su,

A <choice> with minOccurs="0" and maxOccurs="unbounded" of the
subelements will validate any combination of zero or more subelements.


exquisitus wrote:

> Hello All,
>
> I am working in an existing xml that has the following syntax:
>
> 1. element "actions" can have following elements more than once or not
> at all:
> : Sub elements "record", "say", "listen", "play","explain" as in xml
> sample below
> 2. These sub elements could be in any order
>
> Initially I thought of using all but it does not allow more than one
> itration.
>
> What could be the xml schema definition for these?
>
> Any help will be highly appreciated.
>
> Thanks
> Su
>
> --------- Sample XML ------------------------------
> Sample Xml:
> <?xml version="1.0" encoding="utf-8"?>
> <historySubmit sessionId="17A5C33539093BEB3B74E0FEEE476240"
> Version="1.0">
> <sessions storyId="B5BB0DCB31F10C31E4DCC88ECF30F4EB" version="1.0">
> <session start="2004-08-09 16:22:01" duration="00:03:21.122">
> <properties>
> <type>PRACTICE</type>
> <software>SpeaK!</software>
> </properties>
> <actions>
> <record start="00:00:10.083" wordId="0"
> filename="20040809_162211.spx">
> <w id="0" start="0" duration="540" result="MEDIUM" />
> <w id="1" start="540" duration="440" result="FORCED" />
> </record>
> <record start="00:00:12.281" wordId="2"
> filename="20040809_162213.spx" auto="True">
> <w id="2" start="0" duration="580" result="BAD" />
> <w id="3" start="580" duration="480" result="BAD" />
> <w id="4" start="1230" duration="910" result="MEDIUM" />
> <w id="5" start="2470" duration="210" result="FORCED" />
> <w id="6" start="2680" duration="500" result="MEDIUM" />
> <w id="7" start="3850" duration="370" result="MEDIUM" />
> <w id="8" start="4340" duration="520" result="GOOD" />
> <w id="9" start="4890" duration="370" result="BAD" />
> <w id="10" start="5260" duration="210" result="FORCED" />
> <w id="11" start="5470" duration="260" result="MEDIUM" />
> <w id="11" start="5980" duration="330" result="MEDIUM" />
> <w id="12" start="7340" duration="600" result="BAD" />
> <w id="13" start="8530" duration="450" result="FORCED" />
> </record>
> <record start="00:00:22.130" wordId="14"
> filename="20040809_162223.spx" auto="True">
> <w id="14" start="0" duration="500" result="FORCED" />
> </record>
> <record start="00:00:24.141" wordId="15"
> filename="20040809_162225.spx" auto="True">
> <w id="15" start="0" duration="1020" result="MEDIUM" />
> <w id="16" start="1020" duration="610" result="MEDIUM" />
> <w id="17" start="1670" duration="450" result="MEDIUM" />
> <w id="18" start="2480" duration="360" result="MEDIUM" />
> <w id="19" start="2840" duration="410" result="MEDIUM" />
> <w id="20" start="3250" duration="160" result="GOOD" />
> <w id="21" start="3510" duration="190" result="FORCED" />
> <w id="22" start="3700" duration="280" result="GOOD" />
> <w id="23" start="4010" duration="480" result="MEDIUM" />
> </record>
> <play start="00:00:31.154" startId="24" stopId="26" />
> <say start="00:00:33.601" wordId="36" />
> <say start="00:00:34.629" wordId="37" />
> <explain start="00:00:35.596" wordId="37" />
> <play start="00:00:36.671" startId="37" stopId="40" />
> <record start="00:00:40.069" wordId="40"
> filename="20040809_162241.spx">
> <w id="40" start="0" duration="970" result="MEDIUM" />
> </record>
> </actions>
> </session>
> <session start="2004-08-09 16:31:12" duration="00:00:19.872">
> <properties>
> <type>PRACTICE</type>
> <software>SpeaK!</software>
> </properties>
> </session>
> <session start="2004-08-09 16:41:52" duration="00:00:27.915">
> <properties>
> <type>PRACTICE</type>
> <software>SpeaK!</software>
> </properties>
> <actions>
> <record start="00:00:23.364" wordId="37"
> filename="20040809_164216.spx" />
> <say start="00:00:25.702" wordId="37" />
> </actions>
> </session>
> </sessions>
> </historySubmit>
>
Previous Topic:How to Create xml schema with any number of subelement(0-n) and in any order
Next Topic:Correct insertion point for child elements according to schema
Goto Forum:
  


Current Time: Fri May 09 23:28:00 EDT 2025

Powered by FUDForum. Page generated in 0.03870 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top