473,394 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Alternate to Sequence?

Hello,

I am busy creating my first XSD and folloing the examples and tutorials
from "everywhere" I came up with an xsd that does the job, but I need a
alternate to "sequence" because I do not want the XML tags to be in a
specific sequence. (ALL and OPTION do not work for me either)
Some XML test data

<Holder Version="5.0.1">
<Sub1>text</Sub1>
<Sub2>text</Sub2>
<Sub3>text</Sub3>
<Sub4>text</Sub4>
<Sub1>text</Sub1>
<Sub2>text</Sub2>
<Sub3>text</Sub3>
<Sub4>text</Sub4>
<Sub4>text</Sub4>
<Sub4>text</Sub4>
<Sub1>text</Sub1>
</Holder>
The Schema I have created is:

<?xml version='1.0' encoding='UTF-8'?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<xsd:element name="Holder">
<xsd:complexType>
<xsd:sequence>
<xsd:element type="xsd:string" name="Sub1" minOccurs="2"
maxOccurs="5"/>
<xsd:element type="xsd:string" name="Sub2" minOccurs="2"
maxOccurs="5" />
<xsd:element type="xsd:string" name="Sub3"
minOccurs="2" maxOccurs="5" />
<xsd:element type="xsd:string" name="Sub4"
minOccurs="2" maxOccurs="5" />
</xsd:sequence>

<xsd:attribute name="Version" type="xsd:string" use="required"
/>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Can Anyone Help Me?

Thanks
Sean

Jan 23 '06 #1
1 1210
Hi Sean,

Depending on your constraints, you might be able to use <xs:chocie
maxOccurs="unbounded">

--
Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"Sean Burns" <se********@gmail.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
Hello,

I am busy creating my first XSD and folloing the examples and tutorials
from "everywhere" I came up with an xsd that does the job, but I need a
alternate to "sequence" because I do not want the XML tags to be in a
specific sequence. (ALL and OPTION do not work for me either)
Some XML test data

<Holder Version="5.0.1">
<Sub1>text</Sub1>
<Sub2>text</Sub2>
<Sub3>text</Sub3>
<Sub4>text</Sub4>
<Sub1>text</Sub1>
<Sub2>text</Sub2>
<Sub3>text</Sub3>
<Sub4>text</Sub4>
<Sub4>text</Sub4>
<Sub4>text</Sub4>
<Sub1>text</Sub1>
</Holder>
The Schema I have created is:

<?xml version='1.0' encoding='UTF-8'?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<xsd:element name="Holder">
<xsd:complexType>
<xsd:sequence>
<xsd:element type="xsd:string" name="Sub1" minOccurs="2"
maxOccurs="5"/>
<xsd:element type="xsd:string" name="Sub2" minOccurs="2"
maxOccurs="5" />
<xsd:element type="xsd:string" name="Sub3"
minOccurs="2" maxOccurs="5" />
<xsd:element type="xsd:string" name="Sub4"
minOccurs="2" maxOccurs="5" />
</xsd:sequence>

<xsd:attribute name="Version" type="xsd:string" use="required"
/>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Can Anyone Help Me?

Thanks
Sean

Jan 23 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Drifter | last post by:
Using HTTP_REFERER I cannot capture the URL when the link is made via a button: <input type="button" name="Continue" value="Continue Shopping"...
21
by: Steel | last post by:
Hi at all, I have a very long html page with many photo. Therefore the best to print this page is to print the some page as PDF. Therefore I maked a PDF file like my page to print best. I'ld want...
7
by: Matt B | last post by:
I have a need to alternate output row colour where not every row in the sequence is output, so I cannot base the colour on whether position() is odd or even. e.g. .... <xsl:for-each...
4
by: Mark A | last post by:
Trying to upgrade alternate FP9 to alternate FP9a on Red Hat Linux. After running the following command: ../installAltFixPak -y it says it was successful, but no new directory is created in...
1
by: news | last post by:
Hi all, How do you implement alternate line colors in ms access datasheet view Regards Joe --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system...
7
by: Georges Heinesch | last post by:
Hi. I have a problem with alternating background colors in a report. The code below shows, that the first line should always be white (default global boolean value is false). However it depends...
1
by: Eric Lindsay | last post by:
I am trying to understand the differences between and uses of persistent, default and alternate styles. I have read http://www.w3.org/TR/REC-html40/present/styles.html section 14.3.2 on...
5
by: Michael R | last post by:
Searching the net I've found a simple technique to add row numbers and alternate colors (for the even and the uneven row) to a continuous form. 1st step: Create a textbox, send it to background...
9
by: johkar | last post by:
I need some browser implementation clarification. In the below example, the alternate stylesheet could be invoked by user agents that support alternate stylesheets or by script. Are there any...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.