473,587 Members | 2,463 Online
Bytes | Software Development & Data Engineering Community
+ 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=unbou nded), 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=unboo nded).

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 1144

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

Similar topics

0
1617
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 me know what you think, I'm looking into talking about somethin ;)
0
1072
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 (there could be more than one). Does anyone have a suggestion or example for how I might encapsulate that information within my schema? Here's the code for the product without the delivery status, <xs:element name="PRODUCT" minOccurs="1"...
0
1291
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 Public Readonly Property Total() As Decimal
0
345
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 mixin will export services to a >child class, but no semantics will be implied about the child "being a >kind of" the parent. >
1
3105
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 schema and then add a new XML document, set the reference to the schema and start typing in the data in Visual Studio's "data view" window which seems to work fine. But then I view the document in XML view and Visual Studio indicates an error in...
0
2190
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 packaged for shippment. The order is then held pending payment and finally shipped when payment is received. Sometimes prior to shipment the customer calls and wants to change one or more items, wants to change the quantity of one or more items or wants...
3
1452
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
2161
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 language since malformed XML documents break the updater. (I did not have time to add good error-handling code, so run-time errors can abound if the document is malformed.) A sample doc might look something like this: <manifest>
9
2214
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 articles but I am not sure how the code should be for inserting each article? Here is the xml schema and below that is the button_click function I have wrote in C#. <xs:element name="PO"> <xs:complexType> <xs:sequence> ...
0
8219
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
7978
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6629
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5722
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5395
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3845
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1192
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.