473,385 Members | 1,602 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,385 software developers and data experts.

Schema: complexType restrictions

On my first night with schemas, things are not proceeding according to
expectations. Given three distinct complexType layouts:

<sequence> multiple elements in strict sequence
<choice> one element singled out from group of elements
<all> multiple elements in no particular order, each represented
only once

- how would you handle a typical xhtml setup with multiple elements
represented any number of times in no particular order:

<h>Heading</h>
<p>Paragraph</p>
<p>Paragraph</p>
<h>Heading</h>
<p>Paragraph</p>

The implied maxOccur of "1" on the <all> container has really thrown
me off! Thanks for any insight you may provide.

--
Moth
Jul 20 '05 #1
2 1761


Moth wrote:
On my first night with schemas, things are not proceeding according to
expectations. Given three distinct complexType layouts:

<sequence> multiple elements in strict sequence
<choice> one element singled out from group of elements
<all> multiple elements in no particular order, each represented
only once

- how would you handle a typical xhtml setup with multiple elements
represented any number of times in no particular order:

<h>Heading</h>
<p>Paragraph</p>
<p>Paragraph</p>
<h>Heading</h>
<p>Paragraph</p>

The implied maxOccur of "1" on the <all> container has really thrown
me off! Thanks for any insight you may provide.


<h> is not a defined XHTML 1.0 tag but I assume you want <h1> there. As
for XHTML as a schema look at
http://www.w3.org/TR/xhtml-m12n-schema/
There you find

<xs:complexType name="body.type" mixed="true">
<xs:group ref="Block.mix" minOccurs="1" maxOccurs="unbounded"/>
<xs:attributeGroup ref="body.attlist"/>
</xs:complexType>

<xs:element name="body" type="body.type"/>

and then

<xs:group name="Block.mix">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="Heading.class"/>
<xs:group ref="List.class"/>
<xs:group ref="Block.class"/>
<xs:group ref="Misc.class"/>
</xs:choice>
</xs:group>
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2
Martin Honnen wrote:
<h> is not a defined XHTML 1.0 tag but I assume you want <h1> there.
It is XHTML2!
<xs:complexType name="body.type" mixed="true">
<xs:group ref="Block.mix" minOccurs="1" maxOccurs="unbounded"/>
<xs:attributeGroup ref="body.attlist"/>
</xs:complexType>

<xs:element name="body" type="body.type"/>

and then

<xs:group name="Block.mix">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="Heading.class"/>
<xs:group ref="List.class"/>
<xs:group ref="Block.class"/>
<xs:group ref="Misc.class"/>
</xs:choice>
</xs:group>


Thanks alot, this looks very promising!

--
Moth
Jul 20 '05 #3

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

Similar topics

3
by: Kimmo J?rvikangas | last post by:
Dear XML (Schema) experts, As an example I have the following schema: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"...
0
by: Rajesh Jain | last post by:
I Have 2 separate schemas. --------------Schema 1 is defined as below----------- <xs:schema targetNamespace="http://Schemas/1" xmlns="http://Schemas/1" xmlns:xs="http://www.w3.org/2001/XMLSchema"...
1
by: shakuf | last post by:
hi i would like to define a type with restrictions, i used the following schema but i get an error <xs:element name="Latitude"> <xs:complexType> <xs:simpleContent> <xs:extension...
2
by: Shailendra Batham | last post by:
Hello Gurus, I want to put some restrictions on my attribute tag in my XML Schema, anyone out there have any idea how to do that. here is my XML and the XML Schema <?xml version="1.0"...
2
by: Chuck Bowling | last post by:
AIML Schema: http://209.168.21.76/CommunityStarterKit/Downloads/258.aspx I have a Schema (in the link above) that I've been trying to make work in VS2003 for a while now and just can't seem to...
0
by: ruediger | last post by:
Hi there, I want to set up an XML Schema for documents of the following structure: The <root> node contains - an optional <message> element with a text attribute, and - arbitrary further...
1
by: Paul Johnston | last post by:
Hi Working my way through "Learning XML" by Erik Ray and have a question if someone can help me. Using Oxygen 7.2 Doing the section on XML Schema And have a problem with the section below...
1
by: Robert Mago | last post by:
I have an xml document instance in C# which loads an xml schema. I would like to load the restrictions for a complex type in the schema so that the user will choose one, from a drop down list for...
2
by: puffy | last post by:
Hi, Everyone! I'd need a little help. I understand this is not valid, but is there an (easy) way to make it valid? <xs:complexType name="control_Type"> <xs:sequence> <xs:element name="id"...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.