Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Specific failure in XSDEcoreBuilder
Specific failure in XSDEcoreBuilder [message #27198] Wed, 03 September 2003 08:53 Go to next message
Eclipse UserFriend
Originally posted by: ihc.sas-glas.mottmac.com

Specific failure in XSDEcoreBuilder

We’ve been using XSDEcoreBuilder on a trivial schema and now are turning
to some more realistic schemas. However, it choked on a particular
construct, which I have now isolated. The schema

<?xml version = "1.0" encoding = "UTF-8"?>
<xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema">

<xsd:complexType name = "ServiceCategory">
<xsd:simpleContent>
<xsd:extension base = "xsd:boolean"/>
</xsd:simpleContent>
</xsd:complexType>

<xsd:element name = "DialARide">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base = "ServiceCategory"/>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>

</xsd:schema>

produces a null pointer exception during XSDEcoreBuilder.generate(), when
it gets to XSDConstants.isAnyType() – which is called with a null argument
which is then used as if it is a valid object.

It doesn’t seem to matter what is inside the simple content of the base
type (ServiceCategory) we always get the same failure. If however the same
kind of simple extension construct is used directly within an element
rather than as a reference to a separate type, it works OK.

However, I don’t have control of the schemas so I have no workaround.

stack trace:

java.lang.NullPointerException
at org.eclipse.xsd.util.XSDConstants.isAnyType(XSDConstants.jav a:1532)
at
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:324)
at
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:360)
at
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:727)
at
org.eclipse.xsd.ecore.XSDEcoreBuilder.generate(XSDEcoreBuild er.java:902)

Hope someone can help.

Ian Cornwell
Re: Specific failure in XSDEcoreBuilder [message #27236 is a reply to message #27198] Wed, 03 September 2003 11:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

--------------73C15270C1811EC1516DA013
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Ian,

Opening this schema in the Sample XML Schema Editor produces this diagnostic:

XSD: The content type must be the same simple type
'http://www.w3.org/2001/XMLSchema#boolean' as that of the base

Since ServiceCategotry has simple content type, any type derived from it must also
have simple content type. It's best to validate your schemas before attempting to
derive an Ecore model from it. Not that this is a good excuse for null point
exceptions.

By the way, we are doing very extensive rework of the XSD to Ecore so support a
much broader range of valid XML schemas. We will make this work available in the
2.0 stream in the coming weeks.


Ian Cornwell wrote:

> Specific failure in XSDEcoreBuilder
>
> We
Re: Specific failure in XSDEcoreBuilder [message #27273 is a reply to message #27236] Wed, 03 September 2003 11:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ihc.sas-glas.mottmac.com

Sorry Ed,
I got this schema from the UK government so in this case I had taken it on
trust that it was valid!
Thanks for your help.
Ian

Ed Merks wrote:

> Ian,

> Opening this schema in the Sample XML Schema Editor produces this diagnostic:

> XSD: The content type must be the same simple type
> 'http://www.w3.org/2001/XMLSchema#boolean' as that of the base

> Since ServiceCategotry has simple content type, any type derived from it
must also
> have simple content type. It's best to validate your schemas before
attempting to
> derive an Ecore model from it. Not that this is a good excuse for null point
> exceptions.

> By the way, we are doing very extensive rework of the XSD to Ecore so
support a
> much broader range of valid XML schemas. We will make this work available
in the
> 2.0 stream in the coming weeks.


> Ian Cornwell wrote:

> > Specific failure in XSDEcoreBuilder
> >
> > We’ve been using XSDEcoreBuilder on a trivial schema and now are turning
> > to some more realistic schemas. However, it choked on a particular
> > construct, which I have now isolated. The schema
> >
> > <?xml version = "1.0" encoding = "UTF-8"?>
> > <xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema">
> >
> > <xsd:complexType name = "ServiceCategory">
> > <xsd:simpleContent>
> > <xsd:extension base = "xsd:boolean"/>
> > </xsd:simpleContent>
> > </xsd:complexType>
> >
> > <xsd:element name = "DialARide">
> > <xsd:complexType>
> > <xsd:complexContent>
> > <xsd:extension base = "ServiceCategory"/>
> > </xsd:complexContent>
> > </xsd:complexType>
> > </xsd:element>
> >
> > </xsd:schema>
> >
> > produces a null pointer exception during XSDEcoreBuilder.generate(), when
> > it gets to XSDConstants.isAnyType() – which is called with a null argument
> > which is then used as if it is a valid object.
> >
> > It doesn’t seem to matter what is inside the simple content of the base
> > type (ServiceCategory) we always get the same failure. If however the same
> > kind of simple extension construct is used directly within an element
> > rather than as a reference to a separate type, it works OK.
> >
> > However, I don’t have control of the schemas so I have no workaround.
> >
> > stack trace:
> >
> > java.lang.NullPointerException
> > at
org.eclipse.xsd.util.XSDConstants.isAnyType(XSDConstants.jav a:1532)
> > at
> >
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:324)
> > at
> >
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:360)
> > at
> >
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:727)
> > at
> > org.eclipse.xsd.ecore.XSDEcoreBuilder.generate(XSDEcoreBuild er.java:902)
> >
> > Hope someone can help.
> >
> > Ian Cornwell
Re: Specific failure in XSDEcoreBuilder [message #27309 is a reply to message #27236] Wed, 03 September 2003 11:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ihc.sas-glas.mottmac.com

Ed,
On my first reading of your reply I thought you were saying the schema was
invalid, but now I'm not so sure. Are you saying that the restriction
reported by by the sample XML schema editor is an "XML Schema" rule or are
you saying that it is an extra limitation imposed by the current version
of the XSD plugin? (The schema does validate with XSV).

Ian

Ed Merks wrote:

> Ian,

> Opening this schema in the Sample XML Schema Editor produces this diagnostic:

> XSD: The content type must be the same simple type
> 'http://www.w3.org/2001/XMLSchema#boolean' as that of the base

> Since ServiceCategotry has simple content type, any type derived from it
must also
> have simple content type. It's best to validate your schemas before
attempting to
> derive an Ecore model from it. Not that this is a good excuse for null point
> exceptions.

> By the way, we are doing very extensive rework of the XSD to Ecore so
support a
> much broader range of valid XML schemas. We will make this work available
in the
> 2.0 stream in the coming weeks.


> Ian Cornwell wrote:

> > Specific failure in XSDEcoreBuilder
> >
> > We’ve been using XSDEcoreBuilder on a trivial schema and now are turning
> > to some more realistic schemas. However, it choked on a particular
> > construct, which I have now isolated. The schema
> >
> > <?xml version = "1.0" encoding = "UTF-8"?>
> > <xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema">
> >
> > <xsd:complexType name = "ServiceCategory">
> > <xsd:simpleContent>
> > <xsd:extension base = "xsd:boolean"/>
> > </xsd:simpleContent>
> > </xsd:complexType>
> >
> > <xsd:element name = "DialARide">
> > <xsd:complexType>
> > <xsd:complexContent>
> > <xsd:extension base = "ServiceCategory"/>
> > </xsd:complexContent>
> > </xsd:complexType>
> > </xsd:element>
> >
> > </xsd:schema>
> >
> > produces a null pointer exception during XSDEcoreBuilder.generate(), when
> > it gets to XSDConstants.isAnyType() – which is called with a null argument
> > which is then used as if it is a valid object.
> >
> > It doesn’t seem to matter what is inside the simple content of the base
> > type (ServiceCategory) we always get the same failure. If however the same
> > kind of simple extension construct is used directly within an element
> > rather than as a reference to a separate type, it works OK.
> >
> > However, I don’t have control of the schemas so I have no workaround.
> >
> > stack trace:
> >
> > java.lang.NullPointerException
> > at
org.eclipse.xsd.util.XSDConstants.isAnyType(XSDConstants.jav a:1532)
> > at
> >
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:324)
> > at
> >
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:360)
> > at
> >
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:727)
> > at
> > org.eclipse.xsd.ecore.XSDEcoreBuilder.generate(XSDEcoreBuild er.java:902)
> >
> > Hope someone can help.
> >
> > Ian Cornwell
Re: Specific failure in XSDEcoreBuilder [message #27337 is a reply to message #27273] Wed, 03 September 2003 11:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ihc.sas-glas.mottmac.com

Ed,
On first reading of your reply I thought you were saying the schema was
invalid, but now I'm not so sure. The rule below - are you saying this is
an "XML Schema" rule or an extra limitation imposed by the current version
of XSD? (The schema does validate with XSV).
Ian

> Ed Merks wrote:

> > Ian,

> > Opening this schema in the Sample XML Schema Editor produces this
diagnostic:

> > XSD: The content type must be the same simple type
> > 'http://www.w3.org/2001/XMLSchema#boolean' as that of the base

> > Since ServiceCategotry has simple content type, any type derived from it
> must also
> > have simple content type. It's best to validate your schemas before
> attempting to
> > derive an Ecore model from it. Not that this is a good excuse for null
point
> > exceptions.

> > By the way, we are doing very extensive rework of the XSD to Ecore so
> support a
> > much broader range of valid XML schemas. We will make this work available
> in the
> > 2.0 stream in the coming weeks.


> > Ian Cornwell wrote:

> > > Specific failure in XSDEcoreBuilder
> > >
> > > We’ve been using XSDEcoreBuilder on a trivial schema and now are turning
> > > to some more realistic schemas. However, it choked on a particular
> > > construct, which I have now isolated. The schema
> > >
> > > <?xml version = "1.0" encoding = "UTF-8"?>
> > > <xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema">
> > >
> > > <xsd:complexType name = "ServiceCategory">
> > > <xsd:simpleContent>
> > > <xsd:extension base = "xsd:boolean"/>
> > > </xsd:simpleContent>
> > > </xsd:complexType>
> > >
> > > <xsd:element name = "DialARide">
> > > <xsd:complexType>
> > > <xsd:complexContent>
> > > <xsd:extension base = "ServiceCategory"/>
> > > </xsd:complexContent>
> > > </xsd:complexType>
> > > </xsd:element>
> > >
> > > </xsd:schema>
> > >
> > > produces a null pointer exception during XSDEcoreBuilder.generate(), when
> > > it gets to XSDConstants.isAnyType() – which is called with a null
argument
> > > which is then used as if it is a valid object.
> > >
> > > It doesn’t seem to matter what is inside the simple content of the base
> > > type (ServiceCategory) we always get the same failure. If however the
same
> > > kind of simple extension construct is used directly within an element
> > > rather than as a reference to a separate type, it works OK.
> > >
> > > However, I don’t have control of the schemas so I have no workaround.
> > >
> > > stack trace:
> > >
> > > java.lang.NullPointerException
> > > at
> org.eclipse.xsd.util.XSDConstants.isAnyType(XSDConstants.jav a:1532)
> > > at
> > >
>
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:324)
> > > at
> > >
>
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:360)
> > > at
> > >
>
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:727)
> > > at
> > > org.eclipse.xsd.ecore.XSDEcoreBuilder.generate(XSDEcoreBuild er.java:902)
> > >
> > > Hope someone can help.
> > >
> > > Ian Cornwell
Re: Specific failure in XSDEcoreBuilder [message #27359 is a reply to message #27236] Wed, 03 September 2003 12:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ihc.sas-glas.mottmac.com

[my apology if this appears multiple times, perhaps I am being impatient
with the newsgroup software but I cannot see this post on the server (web
version)]

Ed,
On first reading of your reply I thought you were saying the schema was
invalid, but now I'm not so sure. The rule below - are you saying this is
an "XML Schema" rule or an extra limitation imposed by the current version
of XSD? (The schema does validate with XSV).
Ian
Ed Merks wrote:

> Ian,

> Opening this schema in the Sample XML Schema Editor produces this diagnostic:

> XSD: The content type must be the same simple type
> 'http://www.w3.org/2001/XMLSchema#boolean' as that of the base

> Since ServiceCategotry has simple content type, any type derived from it
must also
> have simple content type. It's best to validate your schemas before
attempting to
> derive an Ecore model from it. Not that this is a good excuse for null point
> exceptions.

> By the way, we are doing very extensive rework of the XSD to Ecore so
support a
> much broader range of valid XML schemas. We will make this work available
in the
> 2.0 stream in the coming weeks.


> Ian Cornwell wrote:

> > Specific failure in XSDEcoreBuilder
> >
> > We’ve been using XSDEcoreBuilder on a trivial schema and now are turning
> > to some more realistic schemas. However, it choked on a particular
> > construct, which I have now isolated. The schema
> >
> > <?xml version = "1.0" encoding = "UTF-8"?>
> > <xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema">
> >
> > <xsd:complexType name = "ServiceCategory">
> > <xsd:simpleContent>
> > <xsd:extension base = "xsd:boolean"/>
> > </xsd:simpleContent>
> > </xsd:complexType>
> >
> > <xsd:element name = "DialARide">
> > <xsd:complexType>
> > <xsd:complexContent>
> > <xsd:extension base = "ServiceCategory"/>
> > </xsd:complexContent>
> > </xsd:complexType>
> > </xsd:element>
> >
> > </xsd:schema>
> >
> > produces a null pointer exception during XSDEcoreBuilder.generate(), when
> > it gets to XSDConstants.isAnyType() – which is called with a null argument
> > which is then used as if it is a valid object.
> >
> > It doesn’t seem to matter what is inside the simple content of the base
> > type (ServiceCategory) we always get the same failure. If however the same
> > kind of simple extension construct is used directly within an element
> > rather than as a reference to a separate type, it works OK.
> >
> > However, I don’t have control of the schemas so I have no workaround.
> >
> > stack trace:
> >
> > java.lang.NullPointerException
> > at
org.eclipse.xsd.util.XSDConstants.isAnyType(XSDConstants.jav a:1532)
> > at
> >
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:324)
> > at
> >
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:360)
> > at
> >
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:727)
> > at
> > org.eclipse.xsd.ecore.XSDEcoreBuilder.generate(XSDEcoreBuild er.java:902)
> >
> > Hope someone can help.
> >
> > Ian Cornwell
Re: Specific failure in XSDEcoreBuilder [message #27900 is a reply to message #27337] Wed, 03 September 2003 16:30 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

--------------8A41682EC3F4B0CF212D3B9E
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Ian,

I think you are right. This addition to XSDComplexTypeDefinitionImpl makes sure
the content type is set in the case of empty explicit content:

> etools-diff XSDComplexTypeDefinitionImpl.java
1201a1202
> newContentType =
complexBaseTypeDefinition.getContentType();

When the content type is set, rather than being null, the message goes away and the
null pointer exception doesn't happen. I'll include this fix in the 1.1.1 stream.
Thanks for bringing this to my attention!


Ian Cornwell wrote:

> Ed,
> On first reading of your reply I thought you were saying the schema was
> invalid, but now I'm not so sure. The rule below - are you saying this is
> an "XML Schema" rule or an extra limitation imposed by the current version
> of XSD? (The schema does validate with XSV).
> Ian
>
> > Ed Merks wrote:
>
> > > Ian,
>
> > > Opening this schema in the Sample XML Schema Editor produces this
> diagnostic:
>
> > > XSD: The content type must be the same simple type
> > > 'http://www.w3.org/2001/XMLSchema#boolean' as that of the base
>
> > > Since ServiceCategotry has simple content type, any type derived from it
> > must also
> > > have simple content type. It's best to validate your schemas before
> > attempting to
> > > derive an Ecore model from it. Not that this is a good excuse for null
> point
> > > exceptions.
>
> > > By the way, we are doing very extensive rework of the XSD to Ecore so
> > support a
> > > much broader range of valid XML schemas. We will make this work available
> > in the
> > > 2.0 stream in the coming weeks.
>
> > > Ian Cornwell wrote:
>
> > > > Specific failure in XSDEcoreBuilder
> > > >
> > > > We
Re: Specific failure in XSDEcoreBuilder [message #576776 is a reply to message #27198] Wed, 03 September 2003 11:29 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 26281
Registered: July 2009
Senior Member
--------------73C15270C1811EC1516DA013
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Ian,

Opening this schema in the Sample XML Schema Editor produces this diagnostic:

XSD: The content type must be the same simple type
'http://www.w3.org/2001/XMLSchema#boolean' as that of the base

Since ServiceCategotry has simple content type, any type derived from it must also
have simple content type. It's best to validate your schemas before attempting to
derive an Ecore model from it. Not that this is a good excuse for null point
exceptions.

By the way, we are doing very extensive rework of the XSD to Ecore so support a
much broader range of valid XML schemas. We will make this work available in the
2.0 stream in the coming weeks.


Ian Cornwell wrote:

> Specific failure in XSDEcoreBuilder
>
> We
Re: Specific failure in XSDEcoreBuilder [message #576820 is a reply to message #27236] Wed, 03 September 2003 11:42 Go to previous message
Eclipse UserFriend
Originally posted by: ihc.sas-glas.mottmac.com

Sorry Ed,
I got this schema from the UK government so in this case I had taken it on
trust that it was valid!
Thanks for your help.
Ian

Ed Merks wrote:

> Ian,

> Opening this schema in the Sample XML Schema Editor produces this diagnostic:

> XSD: The content type must be the same simple type
> 'http://www.w3.org/2001/XMLSchema#boolean' as that of the base

> Since ServiceCategotry has simple content type, any type derived from it
must also
> have simple content type. It's best to validate your schemas before
attempting to
> derive an Ecore model from it. Not that this is a good excuse for null point
> exceptions.

> By the way, we are doing very extensive rework of the XSD to Ecore so
support a
> much broader range of valid XML schemas. We will make this work available
in the
> 2.0 stream in the coming weeks.


> Ian Cornwell wrote:

> > Specific failure in XSDEcoreBuilder
> >
> > We’ve been using XSDEcoreBuilder on a trivial schema and now are turning
> > to some more realistic schemas. However, it choked on a particular
> > construct, which I have now isolated. The schema
> >
> > <?xml version = "1.0" encoding = "UTF-8"?>
> > <xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema">
> >
> > <xsd:complexType name = "ServiceCategory">
> > <xsd:simpleContent>
> > <xsd:extension base = "xsd:boolean"/>
> > </xsd:simpleContent>
> > </xsd:complexType>
> >
> > <xsd:element name = "DialARide">
> > <xsd:complexType>
> > <xsd:complexContent>
> > <xsd:extension base = "ServiceCategory"/>
> > </xsd:complexContent>
> > </xsd:complexType>
> > </xsd:element>
> >
> > </xsd:schema>
> >
> > produces a null pointer exception during XSDEcoreBuilder.generate(), when
> > it gets to XSDConstants.isAnyType() – which is called with a null argument
> > which is then used as if it is a valid object.
> >
> > It doesn’t seem to matter what is inside the simple content of the base
> > type (ServiceCategory) we always get the same failure. If however the same
> > kind of simple extension construct is used directly within an element
> > rather than as a reference to a separate type, it works OK.
> >
> > However, I don’t have control of the schemas so I have no workaround.
> >
> > stack trace:
> >
> > java.lang.NullPointerException
> > at
org.eclipse.xsd.util.XSDConstants.isAnyType(XSDConstants.jav a:1532)
> > at
> >
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:324)
> > at
> >
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:360)
> > at
> >
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:727)
> > at
> > org.eclipse.xsd.ecore.XSDEcoreBuilder.generate(XSDEcoreBuild er.java:902)
> >
> > Hope someone can help.
> >
> > Ian Cornwell
Re: Specific failure in XSDEcoreBuilder [message #576861 is a reply to message #27236] Wed, 03 September 2003 11:50 Go to previous message
Eclipse UserFriend
Originally posted by: ihc.sas-glas.mottmac.com

Ed,
On my first reading of your reply I thought you were saying the schema was
invalid, but now I'm not so sure. Are you saying that the restriction
reported by by the sample XML schema editor is an "XML Schema" rule or are
you saying that it is an extra limitation imposed by the current version
of the XSD plugin? (The schema does validate with XSV).

Ian

Ed Merks wrote:

> Ian,

> Opening this schema in the Sample XML Schema Editor produces this diagnostic:

> XSD: The content type must be the same simple type
> 'http://www.w3.org/2001/XMLSchema#boolean' as that of the base

> Since ServiceCategotry has simple content type, any type derived from it
must also
> have simple content type. It's best to validate your schemas before
attempting to
> derive an Ecore model from it. Not that this is a good excuse for null point
> exceptions.

> By the way, we are doing very extensive rework of the XSD to Ecore so
support a
> much broader range of valid XML schemas. We will make this work available
in the
> 2.0 stream in the coming weeks.


> Ian Cornwell wrote:

> > Specific failure in XSDEcoreBuilder
> >
> > We’ve been using XSDEcoreBuilder on a trivial schema and now are turning
> > to some more realistic schemas. However, it choked on a particular
> > construct, which I have now isolated. The schema
> >
> > <?xml version = "1.0" encoding = "UTF-8"?>
> > <xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema">
> >
> > <xsd:complexType name = "ServiceCategory">
> > <xsd:simpleContent>
> > <xsd:extension base = "xsd:boolean"/>
> > </xsd:simpleContent>
> > </xsd:complexType>
> >
> > <xsd:element name = "DialARide">
> > <xsd:complexType>
> > <xsd:complexContent>
> > <xsd:extension base = "ServiceCategory"/>
> > </xsd:complexContent>
> > </xsd:complexType>
> > </xsd:element>
> >
> > </xsd:schema>
> >
> > produces a null pointer exception during XSDEcoreBuilder.generate(), when
> > it gets to XSDConstants.isAnyType() – which is called with a null argument
> > which is then used as if it is a valid object.
> >
> > It doesn’t seem to matter what is inside the simple content of the base
> > type (ServiceCategory) we always get the same failure. If however the same
> > kind of simple extension construct is used directly within an element
> > rather than as a reference to a separate type, it works OK.
> >
> > However, I don’t have control of the schemas so I have no workaround.
> >
> > stack trace:
> >
> > java.lang.NullPointerException
> > at
org.eclipse.xsd.util.XSDConstants.isAnyType(XSDConstants.jav a:1532)
> > at
> >
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:324)
> > at
> >
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:360)
> > at
> >
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:727)
> > at
> > org.eclipse.xsd.ecore.XSDEcoreBuilder.generate(XSDEcoreBuild er.java:902)
> >
> > Hope someone can help.
> >
> > Ian Cornwell
Re: Specific failure in XSDEcoreBuilder [message #576901 is a reply to message #27273] Wed, 03 September 2003 11:57 Go to previous message
Eclipse UserFriend
Originally posted by: ihc.sas-glas.mottmac.com

Ed,
On first reading of your reply I thought you were saying the schema was
invalid, but now I'm not so sure. The rule below - are you saying this is
an "XML Schema" rule or an extra limitation imposed by the current version
of XSD? (The schema does validate with XSV).
Ian

> Ed Merks wrote:

> > Ian,

> > Opening this schema in the Sample XML Schema Editor produces this
diagnostic:

> > XSD: The content type must be the same simple type
> > 'http://www.w3.org/2001/XMLSchema#boolean' as that of the base

> > Since ServiceCategotry has simple content type, any type derived from it
> must also
> > have simple content type. It's best to validate your schemas before
> attempting to
> > derive an Ecore model from it. Not that this is a good excuse for null
point
> > exceptions.

> > By the way, we are doing very extensive rework of the XSD to Ecore so
> support a
> > much broader range of valid XML schemas. We will make this work available
> in the
> > 2.0 stream in the coming weeks.


> > Ian Cornwell wrote:

> > > Specific failure in XSDEcoreBuilder
> > >
> > > We’ve been using XSDEcoreBuilder on a trivial schema and now are turning
> > > to some more realistic schemas. However, it choked on a particular
> > > construct, which I have now isolated. The schema
> > >
> > > <?xml version = "1.0" encoding = "UTF-8"?>
> > > <xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema">
> > >
> > > <xsd:complexType name = "ServiceCategory">
> > > <xsd:simpleContent>
> > > <xsd:extension base = "xsd:boolean"/>
> > > </xsd:simpleContent>
> > > </xsd:complexType>
> > >
> > > <xsd:element name = "DialARide">
> > > <xsd:complexType>
> > > <xsd:complexContent>
> > > <xsd:extension base = "ServiceCategory"/>
> > > </xsd:complexContent>
> > > </xsd:complexType>
> > > </xsd:element>
> > >
> > > </xsd:schema>
> > >
> > > produces a null pointer exception during XSDEcoreBuilder.generate(), when
> > > it gets to XSDConstants.isAnyType() – which is called with a null
argument
> > > which is then used as if it is a valid object.
> > >
> > > It doesn’t seem to matter what is inside the simple content of the base
> > > type (ServiceCategory) we always get the same failure. If however the
same
> > > kind of simple extension construct is used directly within an element
> > > rather than as a reference to a separate type, it works OK.
> > >
> > > However, I don’t have control of the schemas so I have no workaround.
> > >
> > > stack trace:
> > >
> > > java.lang.NullPointerException
> > > at
> org.eclipse.xsd.util.XSDConstants.isAnyType(XSDConstants.jav a:1532)
> > > at
> > >
>
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:324)
> > > at
> > >
>
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:360)
> > > at
> > >
>
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:727)
> > > at
> > > org.eclipse.xsd.ecore.XSDEcoreBuilder.generate(XSDEcoreBuild er.java:902)
> > >
> > > Hope someone can help.
> > >
> > > Ian Cornwell
Re: Specific failure in XSDEcoreBuilder [message #576927 is a reply to message #27236] Wed, 03 September 2003 12:56 Go to previous message
Eclipse UserFriend
Originally posted by: ihc.sas-glas.mottmac.com

[my apology if this appears multiple times, perhaps I am being impatient
with the newsgroup software but I cannot see this post on the server (web
version)]

Ed,
On first reading of your reply I thought you were saying the schema was
invalid, but now I'm not so sure. The rule below - are you saying this is
an "XML Schema" rule or an extra limitation imposed by the current version
of XSD? (The schema does validate with XSV).
Ian
Ed Merks wrote:

> Ian,

> Opening this schema in the Sample XML Schema Editor produces this diagnostic:

> XSD: The content type must be the same simple type
> 'http://www.w3.org/2001/XMLSchema#boolean' as that of the base

> Since ServiceCategotry has simple content type, any type derived from it
must also
> have simple content type. It's best to validate your schemas before
attempting to
> derive an Ecore model from it. Not that this is a good excuse for null point
> exceptions.

> By the way, we are doing very extensive rework of the XSD to Ecore so
support a
> much broader range of valid XML schemas. We will make this work available
in the
> 2.0 stream in the coming weeks.


> Ian Cornwell wrote:

> > Specific failure in XSDEcoreBuilder
> >
> > We’ve been using XSDEcoreBuilder on a trivial schema and now are turning
> > to some more realistic schemas. However, it choked on a particular
> > construct, which I have now isolated. The schema
> >
> > <?xml version = "1.0" encoding = "UTF-8"?>
> > <xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema">
> >
> > <xsd:complexType name = "ServiceCategory">
> > <xsd:simpleContent>
> > <xsd:extension base = "xsd:boolean"/>
> > </xsd:simpleContent>
> > </xsd:complexType>
> >
> > <xsd:element name = "DialARide">
> > <xsd:complexType>
> > <xsd:complexContent>
> > <xsd:extension base = "ServiceCategory"/>
> > </xsd:complexContent>
> > </xsd:complexType>
> > </xsd:element>
> >
> > </xsd:schema>
> >
> > produces a null pointer exception during XSDEcoreBuilder.generate(), when
> > it gets to XSDConstants.isAnyType() – which is called with a null argument
> > which is then used as if it is a valid object.
> >
> > It doesn’t seem to matter what is inside the simple content of the base
> > type (ServiceCategory) we always get the same failure. If however the same
> > kind of simple extension construct is used directly within an element
> > rather than as a reference to a separate type, it works OK.
> >
> > However, I don’t have control of the schemas so I have no workaround.
> >
> > stack trace:
> >
> > java.lang.NullPointerException
> > at
org.eclipse.xsd.util.XSDConstants.isAnyType(XSDConstants.jav a:1532)
> > at
> >
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:324)
> > at
> >
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:360)
> > at
> >
org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcor eBuilder.java:727)
> > at
> > org.eclipse.xsd.ecore.XSDEcoreBuilder.generate(XSDEcoreBuild er.java:902)
> >
> > Hope someone can help.
> >
> > Ian Cornwell
Re: Specific failure in XSDEcoreBuilder [message #577039 is a reply to message #27337] Wed, 03 September 2003 16:30 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 26281
Registered: July 2009
Senior Member
--------------8A41682EC3F4B0CF212D3B9E
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Ian,

I think you are right. This addition to XSDComplexTypeDefinitionImpl makes sure
the content type is set in the case of empty explicit content:

> etools-diff XSDComplexTypeDefinitionImpl.java
1201a1202
> newContentType =
complexBaseTypeDefinition.getContentType();

When the content type is set, rather than being null, the message goes away and the
null pointer exception doesn't happen. I'll include this fix in the 1.1.1 stream.
Thanks for bringing this to my attention!


Ian Cornwell wrote:

> Ed,
> On first reading of your reply I thought you were saying the schema was
> invalid, but now I'm not so sure. The rule below - are you saying this is
> an "XML Schema" rule or an extra limitation imposed by the current version
> of XSD? (The schema does validate with XSV).
> Ian
>
> > Ed Merks wrote:
>
> > > Ian,
>
> > > Opening this schema in the Sample XML Schema Editor produces this
> diagnostic:
>
> > > XSD: The content type must be the same simple type
> > > 'http://www.w3.org/2001/XMLSchema#boolean' as that of the base
>
> > > Since ServiceCategotry has simple content type, any type derived from it
> > must also
> > > have simple content type. It's best to validate your schemas before
> > attempting to
> > > derive an Ecore model from it. Not that this is a good excuse for null
> point
> > > exceptions.
>
> > > By the way, we are doing very extensive rework of the XSD to Ecore so
> > support a
> > > much broader range of valid XML schemas. We will make this work available
> > in the
> > > 2.0 stream in the coming weeks.
>
> > > Ian Cornwell wrote:
>
> > > > Specific failure in XSDEcoreBuilder
> > > >
> > > > We
Previous Topic:Determining XSD/EMF versions programmatically
Next Topic:Removing components from an XML schema
Goto Forum:
  


Current Time: Fri Dec 19 00:50:22 GMT 2014

Powered by FUDForum. Page generated in 0.16384 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software