473,473 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

XML Schema: mixin any order and any quantity

1 New Member
Hi,

I'm trying to build a XML Schema for XMLs like that:

Expand|Select|Wrap|Line Numbers
  1. <book>
  2.    <title>...</title>
  3.    <chapter>...</chapter>
  4.    <chapter>...</chapter>
  5.    <chapter>...</chapter>
  6.    <author>...</autor>
  7. </book>
or like that

Expand|Select|Wrap|Line Numbers
  1. <book>
  2.    <title>...</title>
  3.    <author>...</autor>
  4.    <chapter>...</chapter>
  5.    <chapter>...</chapter>
  6.    <chapter>...</chapter>
  7. </book>
I mean, inside <book> there can be only one <title> (minOccurs=0, maxOccurs=1) and one <author> (minOccurs=0, maxOccurs=1) and many <chapter> (minOccurs=0, maxOccurs=unbounded), but combining them in any order (although all the <chapter>s could be together).

My first thoughts were using <xs:all>, but the problem is that <xs:all> only allows elements with maxOccurs=1, so it doesn't fit with <chapter> (that has maxOccurs=unboonded).

Anybody knows a solution or workaround? I'm getting crazy reviewing the XML Schema reference for some solution, but I'm not finding anything :). Please, any help is very welcome!

Regards,

Fermín

PD. Of course I could do something like:

Expand|Select|Wrap|Line Numbers
  1. <book>
  2.    <title>...</title>
  3.    <author>...</autor>
  4.    <chapters>
  5.       <chapter>...</chapter>
  6.       <chapter>...</chapter>
  7.       <chapter>...</chapter>
  8.    </chapters>
  9. </book>
and define <book> as a <xs:all> of <title>, <author> and <chapters>, but I would like to solve the problem without adding the <chapters> "grouping" element.
Oct 4 '06 #1
0 1142

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: zimba | last post by:
Hello ! If somebody is interested, here is a small hack I've done today. There are still some curious effects, but I'm pretty satisfied by the results, since PHP is not very flexible. Let...
0
by: D. Alvarado | last post by:
I have a schema element reprsenting an order's product. I want to include information within the product to state that the product was delivered, or it was not delivered for the following reasons...
0
by: Lars | last post by:
Hello All, I have a question: is it possible to set the order of the elements of serialized object? Lets say we have Public Class Order Public Price As Decimal Private Quantity As Decimal...
0
by: barnesc | last post by:
>So mixins are just a sub-class of sub-classing? > >I've just found this: > > >A mixin class is a parent class that is inherited from - but not as >a means of specialization. Typically, the...
1
by: Dave Taylor | last post by:
I'm trying to create a simple Schema and associated document in Visual Studio that will store information regarding units and conversion (meters, feet, inches, degrees C, F, K, etc.) I create a...
0
by: Tom | last post by:
Using AccessXP - Access2000 In my application, when an order is entered, inventory is automatically adjusted, a pull list is created, items are pulled to fill the order, and the order is...
3
by: Paul T. Rong | last post by:
Hello there, I am making a report using codes bellow (a part of): ------------------------------- Select Case Forms!!TopBoard Dim strGetSQL As String
3
by: Chris Lieb | last post by:
I am new to XML Schema and am running into a bit of a snag. I have defined an XML-based scripting language for an updater program that I am working on. I would like to make a schema for this...
9
by: turnips11 | last post by:
Hi All, I am trying write a small web app which inserts a purchase order through an xml schema that I have exposed through a web service(using Biztalk 2004). I have that the PO can have many...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
1
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.