xsd:any - namespace problem [message #49795] |
Thu, 05 August 2004 10:44  |
Eclipse User |
|
|
|
Originally posted by: alastair.dunsmore.mottmac.com
Hi,
I have been trying to import an XML Schema file (via Eclipse into a new
EMF Java project) and each time it came back with the same error:
Problems were detected while validating and converting the XML Schemas
Error: XSD: The element 'http://www.trip.org/schema/trip#name' may not
overlap with a wildcard allowing its namespace : URI
file:/C:/appdev/HAREGISTRY/problem_example.xsd Line 4 Column 3
Error: XSD: The element 'http://www.trip.org/schema/trip#linkDistance'
may not overlap with a wildcard allowing its namespace : URI
file:/C:/appdev/HAREGISTRY/problem_example.xsd Line 4 Column 3
Error: XSD: The element 'http://www.trip.org/schema/trip#linkDistance'
may not overlap with a wildcard allowing its namespace : URI
file:/C:/appdev/HAREGISTRY/problem_example.xsd Line 4 Column 3
I have included below a cut down version of the schema that highlights the
problem. It does import if (1) the xsd:any is removed or (2) the
minOccurs="0"
is removed for the xsd:element name="linkDistance"?
Can anyone suggest if this is an issue/bug with XSD or with the XML Schema
I
am dealing with?
Thanks for any help,
Alastair
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.trip.org/schema/trip"
elementFormDefault="qualified" version="2.0"
xmlns="http://www.tript.org/schema/trip"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="RaceSubject">
<xsd:sequence>
<xsd:element name="name" type="xsd:string" minOccurs="0"/>
<xsd:element name="linkDistance" type="xsd:decimal"
minOccurs="0"/>
<xsd:any minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
|
|
|
|
Re: xsd:any - namespace problem [message #49855 is a reply to message #49825] |
Thu, 05 August 2004 11:31  |
Eclipse User |
|
|
|
Originally posted by: alastair.dunsmore.mottmac.com
Thanks very much for your help and quick reply,
Regards,
Alastair.
Ed Merks wrote:
> Alastair,
> Your schema violates the Unique Particle Attribute rule from appendix H
> in the spec. This is a very hard constraint to check, so many
> validators don't bother. When parsing an instance that starts with
> <name> and is followed by <linkDistance> it will be ambiguous whether
> <linkDistance> matches the <linkDistance> element in the grammar, or
> whether it matches the <any> in the grammar, with the <linkDistance>
> element being missing as allowed by the fact that it's optional in the
> grammar.
> Alastair Dunsmore wrote:
> >Hi,
> >
> >I have been trying to import an XML Schema file (via Eclipse into a new
> >EMF Java project) and each time it came back with the same error:
> >
> >Problems were detected while validating and converting the XML Schemas
> > Error: XSD: The element 'http://www.trip.org/schema/trip#name' may not
> >overlap with a wildcard allowing its namespace : URI
> >file:/C:/appdev/HAREGISTRY/problem_example.xsd Line 4 Column 3
> > Error: XSD: The element 'http://www.trip.org/schema/trip#linkDistance'
> >may not overlap with a wildcard allowing its namespace : URI
> >file:/C:/appdev/HAREGISTRY/problem_example.xsd Line 4 Column 3
> > Error: XSD: The element 'http://www.trip.org/schema/trip#linkDistance'
> >may not overlap with a wildcard allowing its namespace : URI
> >file:/C:/appdev/HAREGISTRY/problem_example.xsd Line 4 Column 3
> >
> >
> >I have included below a cut down version of the schema that highlights the
> >problem. It does import if (1) the xsd:any is removed or (2) the
> >minOccurs="0"
> >is removed for the xsd:element name="linkDistance"?
> >
> >Can anyone suggest if this is an issue/bug with XSD or with the XML Schema
> >I
> >am dealing with?
> >
> >Thanks for any help,
> >Alastair
> >
> >
> ><?xml version="1.0" encoding="UTF-8"?>
> ><xsd:schema targetNamespace="http://www.trip.org/schema/trip"
> >elementFormDefault="qualified" version="2.0"
> >xmlns="http://www.tript.org/schema/trip"
> >xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> > <xsd:complexType name="RaceSubject">
> > <xsd:sequence>
> > <xsd:element name="name" type="xsd:string" minOccurs="0"/>
> > <xsd:element name="linkDistance" type="xsd:decimal"
> >minOccurs="0"/>
> > <xsd:any minOccurs="0" maxOccurs="unbounded"/>
> > </xsd:sequence>
> > </xsd:complexType>
> ></xsd:schema>
> >
> >
> >
|
|
|
Re: xsd:any - namespace problem [message #590011 is a reply to message #49795] |
Thu, 05 August 2004 11:04  |
Eclipse User |
|
|
|
Alastair,
Your schema violates the Unique Particle Attribute rule from appendix H
in the spec. This is a very hard constraint to check, so many
validators don't bother. When parsing an instance that starts with
<name> and is followed by <linkDistance> it will be ambiguous whether
<linkDistance> matches the <linkDistance> element in the grammar, or
whether it matches the <any> in the grammar, with the <linkDistance>
element being missing as allowed by the fact that it's optional in the
grammar.
Alastair Dunsmore wrote:
>Hi,
>
>I have been trying to import an XML Schema file (via Eclipse into a new
>EMF Java project) and each time it came back with the same error:
>
>Problems were detected while validating and converting the XML Schemas
> Error: XSD: The element 'http://www.trip.org/schema/trip#name' may not
>overlap with a wildcard allowing its namespace : URI
>file:/C:/appdev/HAREGISTRY/problem_example.xsd Line 4 Column 3
> Error: XSD: The element 'http://www.trip.org/schema/trip#linkDistance'
>may not overlap with a wildcard allowing its namespace : URI
>file:/C:/appdev/HAREGISTRY/problem_example.xsd Line 4 Column 3
> Error: XSD: The element 'http://www.trip.org/schema/trip#linkDistance'
>may not overlap with a wildcard allowing its namespace : URI
>file:/C:/appdev/HAREGISTRY/problem_example.xsd Line 4 Column 3
>
>
>I have included below a cut down version of the schema that highlights the
>problem. It does import if (1) the xsd:any is removed or (2) the
>minOccurs="0"
>is removed for the xsd:element name="linkDistance"?
>
>Can anyone suggest if this is an issue/bug with XSD or with the XML Schema
>I
>am dealing with?
>
>Thanks for any help,
>Alastair
>
>
><?xml version="1.0" encoding="UTF-8"?>
><xsd:schema targetNamespace="http://www.trip.org/schema/trip"
>elementFormDefault="qualified" version="2.0"
>xmlns="http://www.tript.org/schema/trip"
>xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <xsd:complexType name="RaceSubject">
> <xsd:sequence>
> <xsd:element name="name" type="xsd:string" minOccurs="0"/>
> <xsd:element name="linkDistance" type="xsd:decimal"
>minOccurs="0"/>
> <xsd:any minOccurs="0" maxOccurs="unbounded"/>
> </xsd:sequence>
> </xsd:complexType>
></xsd:schema>
>
>
>
|
|
|
Re: xsd:any - namespace problem [message #590022 is a reply to message #49825] |
Thu, 05 August 2004 11:31  |
Eclipse User |
|
|
|
Originally posted by: alastair.dunsmore.mottmac.com
Thanks very much for your help and quick reply,
Regards,
Alastair.
Ed Merks wrote:
> Alastair,
> Your schema violates the Unique Particle Attribute rule from appendix H
> in the spec. This is a very hard constraint to check, so many
> validators don't bother. When parsing an instance that starts with
> <name> and is followed by <linkDistance> it will be ambiguous whether
> <linkDistance> matches the <linkDistance> element in the grammar, or
> whether it matches the <any> in the grammar, with the <linkDistance>
> element being missing as allowed by the fact that it's optional in the
> grammar.
> Alastair Dunsmore wrote:
> >Hi,
> >
> >I have been trying to import an XML Schema file (via Eclipse into a new
> >EMF Java project) and each time it came back with the same error:
> >
> >Problems were detected while validating and converting the XML Schemas
> > Error: XSD: The element 'http://www.trip.org/schema/trip#name' may not
> >overlap with a wildcard allowing its namespace : URI
> >file:/C:/appdev/HAREGISTRY/problem_example.xsd Line 4 Column 3
> > Error: XSD: The element 'http://www.trip.org/schema/trip#linkDistance'
> >may not overlap with a wildcard allowing its namespace : URI
> >file:/C:/appdev/HAREGISTRY/problem_example.xsd Line 4 Column 3
> > Error: XSD: The element 'http://www.trip.org/schema/trip#linkDistance'
> >may not overlap with a wildcard allowing its namespace : URI
> >file:/C:/appdev/HAREGISTRY/problem_example.xsd Line 4 Column 3
> >
> >
> >I have included below a cut down version of the schema that highlights the
> >problem. It does import if (1) the xsd:any is removed or (2) the
> >minOccurs="0"
> >is removed for the xsd:element name="linkDistance"?
> >
> >Can anyone suggest if this is an issue/bug with XSD or with the XML Schema
> >I
> >am dealing with?
> >
> >Thanks for any help,
> >Alastair
> >
> >
> ><?xml version="1.0" encoding="UTF-8"?>
> ><xsd:schema targetNamespace="http://www.trip.org/schema/trip"
> >elementFormDefault="qualified" version="2.0"
> >xmlns="http://www.tript.org/schema/trip"
> >xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> > <xsd:complexType name="RaceSubject">
> > <xsd:sequence>
> > <xsd:element name="name" type="xsd:string" minOccurs="0"/>
> > <xsd:element name="linkDistance" type="xsd:decimal"
> >minOccurs="0"/>
> > <xsd:any minOccurs="0" maxOccurs="unbounded"/>
> > </xsd:sequence>
> > </xsd:complexType>
> ></xsd:schema>
> >
> >
> >
|
|
|
Powered by
FUDForum. Page generated in 0.03053 seconds