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

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:complexType name="kundensucheTyp">
<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:string" minOccurs="0"/>
<xsd:element name="nachname" type="xsd:string"/>
<xsd:element name="strasse" type="xsd:string" minOccurs="0"/>
<xsd:element name="ort" type="xsd:string"/>
<xsd:element name="geburtstag" 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:string" minOccurs="0"/>
<xsd:element name="nachname" type="xsd:string"/>
<xsd:element name="strasse" type="xsd:string" minOccurs="0"/>
<xsd:element name="ort" type="xsd:string" minOccurs="0"/>
<xsd:element name="geburtstag" type="datumTyp" minOccurs="0"/>
</xsd:sequence>

<xsd:sequence> <!-- Suche mit Vertragsnummer -->
<xsd:element name="vertragsnummer" type="vertragsnummernTyp"/>
</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 1644
Binew.@web.de wrote:
Hallo Zusammen,
Hi,
Ein Regel ist beispielsweise dass folgende Suchkriterien angegeben
werden können:
<xsd:complexType name="kundensucheTyp">
<xsd:choice>
<xsd:sequence> <!-- Suche mit Name / Anschrift -->
<xsd:element name="vorname" type="xsd:string" minOccurs="0"/> ....
</xsd:sequence>
<xsd:sequence> <!-- Suche mit Name / Anschrift -->
<xsd:element name="vorname" type="xsd:string" 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:complexType name="kundensucheTyp">
<xsd:choice>
<xsd:sequence>
<!-- Suche mit Name / Anschrift -->
<xsd:element name="vorname" type="xsd:string" minOccurs="0"/>
<xsd:element name="nachname" type="xsd:string"/>
<xsd:element name="strasse" type="xsd:string" minOccurs="0"/>
<xsd:element name="ort" type="xsd:string" minOccurs="0"/>
<xsd:element name="geburtstag" type="datumTyp" minOccurs="0"/>
</xsd:sequence>
<xsd:sequence>
<!-- Suche mit Vertragsnummer -->
<xsd:element name="vertragsnummer" type="vertragsnummernTyp"/>
</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
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),...
5
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? ...
2
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...
2
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...
10
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;...
1
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...
1
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...
12
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...
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?
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
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,...
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...
0
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...
0
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...

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.