Skip to content

XML validation errors (incomplete project-based XSD schemas resolution?) #447

Closed
@mauromol

Description

@mauromol

Using STS4 4.6.0 in Eclipse.
In #108 project-based XSD schema resolution was implemented. I'm pretty sure I saw this working in other places, but I have a XML file using Spring Integration namespace XML elements for which this resolution seems to (partially) fail.
I have Spring Integration 4.3.21 in the classpath (both core and http modules) and snippets like these:

<int:header-enricher
    input-channel="preAuthRequestChannel"
    output-channel="restServiceRequestChannel">
    <int:header name="myHeader"
        expression="someGreatExpression" />
</int:header-enricher>

The above is marked with this error:

cvc-complex-type.3.2.2: Attribute 'expression' is not allowed to appear in element 'int:header'.

Similar errors are given on <int-http:outbound-gateway> attributes like http-method-expression or request-factory.
I'm using the unversioned namespaces:

<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	default-lazy-init="true"
	xmlns:int-http="http://www.springframework.org/schema/integration/http"
	xmlns:int="http://www.springframework.org/schema/integration"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
		http://www.springframework.org/schema/integration/http https://www.springframework.org/schema/integration/http/spring-integration-http.xsd">

If I replace the unversioned XSDs with the versioned (4.3) ones, those errors go away. But I would like to avoid it.
The Spring Boot language server log doesn't show any error/exception. The XML where I have this problem seems to be detected as well as any updates to it:

17:22:07.712 [pool-4-thread-1] INFO  o.s.i.v.boot.app.SpringSymbolIndex - Update document [xml changed]: file:///home/mauro/svn/DCS-SHOP-trunk/shop-commons/src/main/resources/context/myfile-foo.xml

Basic XML code assist for attribute names work (even for those attributes that are marked in red!), as well as further STS4 code assist within <bean> attributes (like class or property).

If I right click on the editor and choose "Validate", I get "The validation completed with no errors or warnings", yet I have those errors in the left vertical ruler and attributes are underlined in red.

I tried to:

  • restart Eclipse
  • clean that project
  • close and reopen that project

without success.

Any idea on what is going on?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions