Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Error: XSD: Type reference '#null' is unresolved in XML Schema Import into EMF
Error: XSD: Type reference '#null' is unresolved in XML Schema Import into EMF [message #114065] Fri, 07 March 2008 15:29 Go to next message
Gerrit  is currently offline Gerrit Friend
Messages: 30
Registered: July 2009
Member
Hello everyone,


I am getting lots of errors when importing the DITA XML schema
( http://docs.oasis-open.org/dita/v1.1/CD01/schema/ditaschema. zip) into a
new EMF Project. Many of these errors also appeared before when validating
the schema in Eclipse with the "Validate" context menu of the
org.eclipse.xsd plugin. However, after I changed some parts of the schema,
it gets validated fine in Eclipse (i.e. no errors show up), but the EMF
XML schema import still throws additional errors, even though I believe
that org.eclipse.xsd.ecore.importer is using org.eclipse.xsd as well.

Many of the errors were due to the schema using a catalog, which can be
integrated into the workspace with the XML Catalog menu. The EMF import,
however, doesn't seem to use it, even when importing from the workspace.
The errors didn't disappear until I switched to direct references instead
of using the catalog.


There is still another large group of errors, for which I found no
explanation yet:

Error: XSD: Type reference '#null' is unresolved : URI
platform:/resource/ditaschema/ditaschema/topicMod.xsd Line 157 Column 3
Error: XSD: Type reference '#null' is unresolved : URI
platform:/resource/ditaschema/ditaschema/topicMod.xsd Line 178 Column 3
Error: XSD: Type reference '#null' is unresolved : URI
platform:/resource/ditaschema/ditaschema/topicMod.xsd Line 211 Column 3
...


The given lines are starting points of element definition blocks like this
one:

<xs:element name="no-topic-nesting">
<xs:annotation>
<xs:documentation>
...
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:complexContent>
<xs:extension base="no-topic-nesting.class">
<xs:attribute ref="class" default="- topic/no-topic-nesting "/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:complexType name="no-topic-nesting.class">
<xs:attributeGroup ref="global-atts"/>
</xs:complexType>



These errors don't appear when validating the schema separately.

The weird part is that the error message can't give the names of the
unresolved references. The _UI_UnresolvedTypeDefinition_message is defined
in the plugin.properties and used by the XSD_Type_DeclarationImpl classes,
for their respective validate() methods. These methods explicitely check
for null XSDTypeDefinition, in which case they pass an empty string. This
seems to imply that the XSDTypeDefinition is not null, but its URI is,
even though a reference basically consists of nothing but a URI. Could it
be that the "unresolved" references do not exist, but are rather generated
implicitely by the EMF importer?


I'd be happy if someone would have some ideas as to

1. What causes these errors?
2. How could I further analyze them if no URI is given?
3. Why do they only appear in the EMF importer, but not in the normal
validation?


In general, I'd like to know the differences between the normal XML Schema
Validation and the XML Schema Import into EMF, e.g. in which ways the
latter might be stricter.


Many thanks in advance,
Gerrit
Re: Error: XSD: Type reference '#null' is unresolved in XML Schema Import into EMF [message #114080 is a reply to message #114065] Fri, 07 March 2008 15:49 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Gerrit,

This question would be more appropriate for the EMF newsgroup itself.

Comments below.


Gerrit wrote:
> Hello everyone,
>
>
> I am getting lots of errors when importing the DITA XML schema
> ( http://docs.oasis-open.org/dita/v1.1/CD01/schema/ditaschema. zip) into
> a new EMF Project. Many of these errors also appeared before when
> validating the schema in Eclipse with the "Validate" context menu of
> the org.eclipse.xsd plugin. However, after I changed some parts of the
> schema, it gets validated fine in Eclipse (i.e. no errors show up),
> but the EMF XML schema import still throws additional errors, even
> though I believe that org.eclipse.xsd.ecore.importer is using
> org.eclipse.xsd as well.
It's possible there's a bug. I'd need to be able to reproduce it.
>
> Many of the errors were due to the schema using a catalog, which can
> be integrated into the workspace with the XML Catalog menu. The EMF
> import, however, doesn't seem to use it, even when importing from the
> workspace. The errors didn't disappear until I switched to direct
> references instead of using the catalog.
The XML Catalog is provided by WTP and WTP depends on XSD and EMF, but
not vice versa. So we don't/can't make use of the XML catalog.
>
>
> There is still another large group of errors, for which I found no
> explanation yet:
>
> Error: XSD: Type reference '#null' is unresolved : URI
> platform:/resource/ditaschema/ditaschema/topicMod.xsd Line 157 Column 3
> Error: XSD: Type reference '#null' is unresolved : URI
> platform:/resource/ditaschema/ditaschema/topicMod.xsd Line 178 Column 3
> Error: XSD: Type reference '#null' is unresolved : URI
> platform:/resource/ditaschema/ditaschema/topicMod.xsd Line 211 Column 3
> ...
>
>
> The given lines are starting points of element definition blocks like
> this one:
>
> <xs:element name="no-topic-nesting">
> <xs:annotation>
> <xs:documentation>
> ... </xs:documentation>
> </xs:annotation>
> <xs:complexType>
> <xs:complexContent>
> <xs:extension base="no-topic-nesting.class">
> <xs:attribute ref="class" default="- topic/no-topic-nesting "/>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
> </xs:element>
> <xs:complexType name="no-topic-nesting.class">
> <xs:attributeGroup ref="global-atts"/>
> </xs:complexType>
>
>
I don't see any type references so perhaps there is a bug here. If you
send me a zip file of the schemas with properly working include/import
schema locations, I can have a look. You can send it directly to merks
at ca dot ibm dot com.
>
> These errors don't appear when validating the schema separately.
>
> The weird part is that the error message can't give the names of the
> unresolved references. The _UI_UnresolvedTypeDefinition_message is
> defined in the plugin.properties and used by the
> XSD_Type_DeclarationImpl classes, for their respective validate()
> methods. These methods explicitely check for null XSDTypeDefinition,
> in which case they pass an empty string. This seems to imply that the
> XSDTypeDefinition is not null, but its URI is, even though a reference
> basically consists of nothing but a URI. Could it be that the
> "unresolved" references do not exist, but are rather generated
> implicitely by the EMF importer?
I really need to see it in action...
>
>
> I'd be happy if someone would have some ideas as to
>
> 1. What causes these errors?
> 2. How could I further analyze them if no URI is given?
> 3. Why do they only appear in the EMF importer, but not in the normal
> validation?
I suspect you could just ignore these errors and you'd still get good
results. I'm happy to have a look at them though.
>
>
> In general, I'd like to know the differences between the normal XML
> Schema Validation and the XML Schema Import into EMF, e.g. in which
> ways the latter might be stricter.
They should be the same. They're using the same underlying model. But
if you are validating in the context of WTP, catalogs might kick in that
don't kick in when using EMF's XSD directly...
>
>
> Many thanks in advance,
> Gerrit
>
>
>
Re: Error: XSD: Type reference '#null' is unresolved in XML Schema Import into EMF [message #615625 is a reply to message #114065] Fri, 07 March 2008 15:49 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Gerrit,

This question would be more appropriate for the EMF newsgroup itself.

Comments below.


Gerrit wrote:
> Hello everyone,
>
>
> I am getting lots of errors when importing the DITA XML schema
> ( http://docs.oasis-open.org/dita/v1.1/CD01/schema/ditaschema. zip) into
> a new EMF Project. Many of these errors also appeared before when
> validating the schema in Eclipse with the "Validate" context menu of
> the org.eclipse.xsd plugin. However, after I changed some parts of the
> schema, it gets validated fine in Eclipse (i.e. no errors show up),
> but the EMF XML schema import still throws additional errors, even
> though I believe that org.eclipse.xsd.ecore.importer is using
> org.eclipse.xsd as well.
It's possible there's a bug. I'd need to be able to reproduce it.
>
> Many of the errors were due to the schema using a catalog, which can
> be integrated into the workspace with the XML Catalog menu. The EMF
> import, however, doesn't seem to use it, even when importing from the
> workspace. The errors didn't disappear until I switched to direct
> references instead of using the catalog.
The XML Catalog is provided by WTP and WTP depends on XSD and EMF, but
not vice versa. So we don't/can't make use of the XML catalog.
>
>
> There is still another large group of errors, for which I found no
> explanation yet:
>
> Error: XSD: Type reference '#null' is unresolved : URI
> platform:/resource/ditaschema/ditaschema/topicMod.xsd Line 157 Column 3
> Error: XSD: Type reference '#null' is unresolved : URI
> platform:/resource/ditaschema/ditaschema/topicMod.xsd Line 178 Column 3
> Error: XSD: Type reference '#null' is unresolved : URI
> platform:/resource/ditaschema/ditaschema/topicMod.xsd Line 211 Column 3
> ...
>
>
> The given lines are starting points of element definition blocks like
> this one:
>
> <xs:element name="no-topic-nesting">
> <xs:annotation>
> <xs:documentation>
> ... </xs:documentation>
> </xs:annotation>
> <xs:complexType>
> <xs:complexContent>
> <xs:extension base="no-topic-nesting.class">
> <xs:attribute ref="class" default="- topic/no-topic-nesting "/>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
> </xs:element>
> <xs:complexType name="no-topic-nesting.class">
> <xs:attributeGroup ref="global-atts"/>
> </xs:complexType>
>
>
I don't see any type references so perhaps there is a bug here. If you
send me a zip file of the schemas with properly working include/import
schema locations, I can have a look. You can send it directly to merks
at ca dot ibm dot com.
>
> These errors don't appear when validating the schema separately.
>
> The weird part is that the error message can't give the names of the
> unresolved references. The _UI_UnresolvedTypeDefinition_message is
> defined in the plugin.properties and used by the
> XSD_Type_DeclarationImpl classes, for their respective validate()
> methods. These methods explicitely check for null XSDTypeDefinition,
> in which case they pass an empty string. This seems to imply that the
> XSDTypeDefinition is not null, but its URI is, even though a reference
> basically consists of nothing but a URI. Could it be that the
> "unresolved" references do not exist, but are rather generated
> implicitely by the EMF importer?
I really need to see it in action...
>
>
> I'd be happy if someone would have some ideas as to
>
> 1. What causes these errors?
> 2. How could I further analyze them if no URI is given?
> 3. Why do they only appear in the EMF importer, but not in the normal
> validation?
I suspect you could just ignore these errors and you'd still get good
results. I'm happy to have a look at them though.
>
>
> In general, I'd like to know the differences between the normal XML
> Schema Validation and the XML Schema Import into EMF, e.g. in which
> ways the latter might be stricter.
They should be the same. They're using the same underlying model. But
if you are validating in the context of WTP, catalogs might kick in that
don't kick in when using EMF's XSD directly...
>
>
> Many thanks in advance,
> Gerrit
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Storing GMF diagram object with teneo
Next Topic:[Teneo] JoinColumn Annotation
Goto Forum:
  


Current Time: Fri Mar 29 14:19:07 GMT 2024

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

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

Back to the top