Warning – Cannot resolve the ‘schemaLocation’ attribute


I always take compiler warnings seriously and at least investigate them before releasing.

In one of the solutions I work on I consequently received the warning  ‘Cannot resolve the ‘schemaLocation’ attribute’. This solution contains a BizTalk project with a lot of schemas. For each schema multiple occurrences of this warning where reported. This lead to a long list of warnings.

Although this is a warning and it didn’t seem to bother anything at run-time I didn’t like the excessive list of warnings.

It turned out that the BizTalk compiler is quite strict in the way the imports are defined for schemas in other assemblies. We have schema types defined in schemas in other assemblies. We reference those assemblies and use the types in the schemas. Something like this:

<xs:import namespace="http://biztalk_server_project1.myschematypes" schemaLocation="BizTalk_Server_Project1.MySchemaTypes" />

As you can see we had the ‘namespace’ before the ‘schemaLocation’ attribute in the import statement. We manually added the import statements and didn’t bother about the sequence of those attributes. However it seems the BizTalk compiler wants the imports to be defined as:

<xs:import schemaLocation="BizTalk_Server_Project1.MySchemaTypes" namespace="http://biztalk_server_project1.myschematypes" />

This also the sequence used when you import a schema in the BizTalk schema editor.

After putting all the ‘schemaLocation’ attributes before the ‘namespace’ attributes the warnings were gone.

Not a showstopper but still worth mentioning in my view.

About these ads

2 Responses to Warning – Cannot resolve the ‘schemaLocation’ attribute

  1. Warning – Cannot resolve the ‘schemaLocation’ attribute…

    I always take compiler warnings seriously and at least inves ……

  2. Leonid Ganeline says:

    Randal, good catch!
    To me it looks like a 100% bug. The XML standard: “Note that the order of attribute specifications in a start-tag or empty-element tag is not significant.” (see here http://www.w3.org/TR/xml/#sec-starttags).

    Regards!
    Leonid

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: