Project

General

Profile

Actions

Bug #2054

closed

use of <any> in additionalMetadata is invalid

Added by Saurabh Garg over 19 years ago. Updated almost 16 years ago.

Status:
Resolved
Priority:
Immediate
Assignee:
Category:
eml - general bugs
Target version:
Start date:
03/31/2005
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:
2054

Description

Johnoel from Hawaii also reported the same problem which Margaret reported
earlier while using latest version of XMLSpy2005 or oXygen to parse XML Schema

The error from oXygen is:
E cos-nonambig: "":describes and WC[##any] (or elements from their substitution
group) violate "Unique Particle Attribution". During validation against this
schema, ambiguity would be created for those two particles. eml.xsd 246:27

More information about this can be found here: http://www.w3.org/TR/2000/WD-
xmlschema-1-20000407/#non-ambig

Following text from the above page descibes what is happening:
We say that two non-group particles overlap if

So the schema that we have in EML is:
<xs:complexType>
<xs:sequence>
<xs:element name="describes" type="xs:string" minOccurs="0"
maxOccurs="unbounded">
</xs:element>
<xs:any processContents="lax">
</xs:any>
</xs:sequence>
<xs:attribute name="describes" type="xs:string" use="optional"/>
<xs:attribute name="id" type="res:IDType" use="optional"/>
</xs:complexType>

This is a problem because <xs:any> is a wildcard and could be anything
including <describes> itself. In particular a document which has following text
can confuse the parser
<additionalMetadata>
<describes>1</describes>
<describes>2</describes>
<describes>3</describes>
</additionalMetadata>
So here the parser doesnt know if the last <describes> tag should be
considered as <xs:any> or not.
(Though I think that as only one <xs:any> is possible, the last tag should be
takes as <xs:any> by default. But I must be missing something as both oXygen
and XMLSpy complain about this)

I was able to correct this error by doing the following
1. <describes> tag is required and can occur only once
<xs:complexType>
<xs:sequence>
<xs:element name="describes" type="xs:string">
</xs:element>
<xs:any processContents="lax">
</xs:any>
</xs:sequence>
<xs:attribute name="id" type="res:IDType" use="optional"/>
</xs:complexType>
2. describes is an attribute of additionalMetadata
<xs:complexType>
<xs:sequence>
<xs:any processContents="lax">
</xs:any>
</xs:sequence>
<xs:attribute name="describes" type="xs:string" use="optional"/>
<xs:attribute name="id" type="res:IDType" use="optional"/>
</xs:complexType>
3. <xs:any> is inside the <describes> tag
<xs:complexType>
<xs:sequence>
<xs:element name="describes" type="xs:string" minOccurs="0"
maxOccurs="1">
<xs:sequence>
<xs:any processContents="lax">
</xs:any>
</xs:sequence>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="res:IDType" use="optional"/>
</xs:complexType>

I think the first one would be the best in terms of minimum change to the
schema.


Files

eml.xsd.patch (5.92 KB) eml.xsd.patch Matt Jones, 06/30/2006 09:05 AM
eml.xsd (19.1 KB) eml.xsd Matt Jones, 06/30/2006 09:07 AM

Related issues

Is duplicate of EML - Bug #2479: unable to validate eml.xsd and related schemas with XML*Spy and related suite of productsResolvedMatt Jones06/28/2006

Actions
Blocked by EML - Bug #3508: create a stylesheet for EML2.0.x to EML 2.1.0NewMatt Jones10/06/2008

Actions
Actions

Also available in: Atom PDF