Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect error range for cvc-identity-constraint.4.1 #1210

Closed
angelozerr opened this issue May 31, 2022 · 1 comment · Fixed by #1214
Closed

Incorrect error range for cvc-identity-constraint.4.1 #1210

angelozerr opened this issue May 31, 2022 · 1 comment · Fixed by #1214
Labels
bug Something isn't working good first issue Good for newcomers validation
Milestone

Comments

@angelozerr
Copy link
Contributor

Given this XML file:

<?xml version="1.0" encoding="UTF-8" ?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    id="WebApp_ID" version="2.5"> 
    
		<servlet>
        <servlet-name>dispatcher</servlet-name>
        <servlet-class>
            org.springframework.web.servlet.DispatcherServlet
        </servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

		<servlet>
			<servlet-name>dispatcher</servlet-name>
			<servlet-class>
					org.springframework.web.servlet.DispatcherServlet
			</servlet-class>
			<load-on-startup>1</load-on-startup>
	</servlet>
	
</web-app>

The error range is not correct (at end of the servlet-name) :

image

The error range should higlight the dispatcher text node.

@angelozerr angelozerr added bug Something isn't working good first issue Good for newcomers validation labels May 31, 2022
@angelozerr
Copy link
Contributor Author

In the previous sample it is the text node "dispatcher" that it must be highlighted but when I tried the issue redhat-developer/vscode-xml#716 if you open the text.xml you will see the same error but it os for attribute:

image

For writting test I think it should be good to write a XSD file (stored in the test resources folder) with those constraint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers validation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant