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

Fixed error range for duplicate attribute. #452

Closed
angelozerr opened this issue Jun 20, 2019 · 1 comment
Closed

Fixed error range for duplicate attribute. #452

angelozerr opened this issue Jun 20, 2019 · 1 comment
Assignees
Labels
bug Something isn't working validation XSD
Milestone

Comments

@angelozerr
Copy link
Contributor

If we have duplicate prefix (see following sample with duplicate xmlns:tns) :

<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
	xmlns:tns="http://camel.apache.org/schema/spring"
	xmlns:tns="http://camel.apache.org/schema/spring" version="1.0">

The error range highlight the last attribute (in this case version)

image

although it should highlight the first or second xmlns:ts.

Problem comes from XMLSyntaxErrorCode with AttributeNSNotUnique

Please note there are the same problem with attribute without NS (AttributeNotUnique):

<a attr="" attr="" attr2="" />

Today attr2 is higlighted although it should be attr which should be highligted.

image

To fix this 2 problems, we must use arguments which contains the attribute name to highlight by using XMLPositionUtility.selectAttributeNameFromGivenNameAt I think.

@angelozerr
Copy link
Contributor Author

Fixed with #456

@angelozerr angelozerr added the bug Something isn't working label Jul 23, 2019
@angelozerr angelozerr changed the title Error range for duplicate attribute. Error range for duplicate attribute. Jul 23, 2019
@angelozerr angelozerr changed the title Error range for duplicate attribute. Fixed error range for duplicate attribute. Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working validation XSD
Projects
None yet
Development

No branches or pull requests

2 participants