473,795 Members | 2,875 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ambiguous content model : the following particles overlap

Hallo Zusammen,

ich habe noch ein Problem
und zwar bilde ich meine XML Logik in XSD Schemas ab.

Ein Regel ist beispielsweise dass folgende Suchkriterien angegeben
werden können:
<xsd:complexTyp e name="kundensuc heTyp">
<xsd:choice>

<!-- Beim Suchen von Hostpersonen sind der Nachname, Geburtstag
und Ort Mussfelder. -->
<xsd:sequence > <!-- Suche mit Name / Anschrift -->
<xsd:element name="vorname" type="xsd:strin g" minOccurs="0"/>
<xsd:element name="nachname" type="xsd:strin g"/>
<xsd:element name="strasse" type="xsd:strin g" minOccurs="0"/>
<xsd:element name="ort" type="xsd:strin g"/>
<xsd:element name="geburtsta g" type="datumTyp"/>
</xsd:sequence>

<!-- Für die Suche aus einer anderen APP heraus soll lediglich
der Nachname als Mussfeld definiert werden. -->
<xsd:sequence > <!-- Suche mit Name / Anschrift -->
<xsd:element name="vorname" type="xsd:strin g" minOccurs="0"/>
<xsd:element name="nachname" type="xsd:strin g"/>
<xsd:element name="strasse" type="xsd:strin g" minOccurs="0"/>
<xsd:element name="ort" type="xsd:strin g" minOccurs="0"/>
<xsd:element name="geburtsta g" type="datumTyp" minOccurs="0"/>
</xsd:sequence>

<xsd:sequence > <!-- Suche mit Vertragsnummer -->
<xsd:element name="vertragsn ummer" type="vertragsn ummernTyp"/>
</xsd:sequence>

</xsd:choice>
</xsd:complexType >
Wir erstellen die XSD und XML mittels WSAD. Hier bekommen wir beim
validieren keinen Fehler. Lassen wir es aber über XML Spy laufen oder
den "Schema Quality Checker" ebenfalls IBM,
dann bekommen wir folgenden Fehler:
Ambiguous content model : the following particles overlap

Woran ligt das? Verstoßen wir hier wirklichgegen einen XSD Standard?

Vielen Dank für eure Hilfe...

Jan 31 '06 #1
3 1660
Binew.@web.de wrote:
Hallo Zusammen,
Hi,
Ein Regel ist beispielsweise dass folgende Suchkriterien angegeben
werden können:
<xsd:complexTyp e name="kundensuc heTyp">
<xsd:choice>
<xsd:sequence > <!-- Suche mit Name / Anschrift -->
<xsd:element name="vorname" type="xsd:strin g" minOccurs="0"/> ....
</xsd:sequence>
<xsd:sequence > <!-- Suche mit Name / Anschrift -->
<xsd:element name="vorname" type="xsd:strin g" minOccurs="0"/> .... </xsd:sequence>
....
</xsd:choice>
</xsd:complexType >


Yes that is verboten.

XSD types must be such that you can determine every decision made at a
regular expression, as a document is being read, without having to
guess. In your schema, there's no way of telling from start, whether an
element sequence matches the first or second branch of your choice. In
fact, there is not way to tell AT ALL which branch is the one that must
be taken (an XSD validation must decide that, not just approve, because
it is obsessed with types and typing .. silly but true). If you have all
of vorname, nachname, strasse, ort, geburtstag, which one matches then ;) ?

You have to unify them both into one. Or kick out XML Schema and use
Relax NG.

Soren
Jan 31 '06 #2
Ambiguity errors are generally resolved by
1. rewriting the content model in a non ambiguous way
2. relaxing the content model and place the constraints at some other
level

In your case your complex type can be rewriten in a non ambiguous way
as:

<xsd:complexTyp e name="kundensuc heTyp">
<xsd:choice>
<xsd:sequence >
<!-- Suche mit Name / Anschrift -->
<xsd:element name="vorname" type="xsd:strin g" minOccurs="0"/>
<xsd:element name="nachname" type="xsd:strin g"/>
<xsd:element name="strasse" type="xsd:strin g" minOccurs="0"/>
<xsd:element name="ort" type="xsd:strin g" minOccurs="0"/>
<xsd:element name="geburtsta g" type="datumTyp" minOccurs="0"/>
</xsd:sequence>
<xsd:sequence >
<!-- Suche mit Vertragsnummer -->
<xsd:element name="vertragsn ummer" type="vertragsn ummernTyp"/>
</xsd:sequence>
</xsd:choice>
</xsd:complexType >

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Feb 1 '06 #3
George Bina wrote:
Ambiguity errors are generally resolved by
1. rewriting the content model in a non ambiguous way
2. relaxing the content model and place the constraints at some other
level

In your case your complex type can be rewriten in a non ambiguous way
as:


Yeah I think I tried to say that ;)

(had they only defined that darn language as restrained-competition...)

Soren
Feb 2 '06 #4

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

Similar topics

1
3357
by: Abhijit | last post by:
I am working in a data warehousing environment which gets sourced from Oracle ERP (AR/GL/AP). The dimensional entities associated with incoming data are GL Code (e.g. 110), Department (e.g. 1050), Core account (e.g. 301) , sub account (e.g 9). The incoming data needs to be mapped to key performance indicators (KPI) e.g. 'All Other Revenue', 'OEM Revenue' etc. The mapping is driven by GL, Dept, Core account , sub-account ranges. Example - ...
5
1490
by: Richard Light | last post by:
A literal-minded reading of the XML 1.0 Spec suggests that elements with content model ANY should not have comments or PIs as their immediate children. Is there a particular reason for this? Richard Light -- Richard Light SGML/XML and Museum Information Consultancy richard@light.demon.co.uk
2
12040
by: Catherine Lynn Wood | last post by:
I need to know how to overlap DIV content within 'relative' associated rendering. I am building div layers in the middle of a page and when I set positioning to absolute in the CSS, it references back to 0,0 on the entire page. If I set it to relative, the div layers will not overlap as needed. I prefer to avoid javascripting an 'innerHTML' re-write of a single div and would instead like to build two layers that can reside at the same...
2
3951
by: R0bert Neville | last post by:
I have been working a rounded content box approach. The layout rendered beautifully in Firefox, yet IE threw a wrench into my layout. The approach has to be re-thought and aligned for compatibility with IE. The HTML and CSS code validates on the server. The situation may relate to the Box Model Hack, but I have little familiarity with the various workarounds and hack techniques. My questions relate to improving my current approach and...
10
7191
by: Michael Strorm | last post by:
Hi! I've been having problems with a DTD. Having had the Sun XML validator reject a document, I put it through 'xmllint' for more information. 'Xmllint' noted a problem with the DTD itself; "validity error : Content model of section is not determinist: (text , (list , text)* , list?)" Here's a very simplified version of the DTD demonstrating the problem:-
1
10011
by: Alex Zhitlenok | last post by:
Hi, My question is how to resolve in C# ambiguous overloaded operators? Let say, I have two unrelated classes A and B, each one implements overloaded operator + with the first parameter of type A, and the second one of type B. Let say, these are not my classes and I know nothing about the implementation. As system doesn't know what code must be used for resolving the language construction a+b (where A a; and B b;), it returns "The call...
1
1936
by: mahesh.kanakaraj | last post by:
Hi All, I have a confusion in finding the 'effective content' of a complex type definition in a XML Schema. I shall give you an example situation to clearly explain my problem. Let's have an element declaration as follows:
12
2047
by: Nathan Sokalski | last post by:
I have several CustomControls that I have written for my project. However, when I try to compile I recieve the following warning & errors: Warning 32 Could not resolve this reference. Could not locate the assembly "nathansokalski_com_test, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors....
0
10443
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...
0
10216
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10165
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,...
1
7543
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
6783
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
5437
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...
0
5565
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
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
3
2921
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.