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

Fix error range for cvc-complex-type.2.4.f #368

Closed
fbricon opened this issue May 7, 2019 · 0 comments · Fixed by #381
Closed

Fix error range for cvc-complex-type.2.4.f #368

fbricon opened this issue May 7, 2019 · 0 comments · Fixed by #381
Labels
bug Something isn't working good first issue Good for newcomers validation XSD
Milestone

Comments

@fbricon
Copy link
Contributor

fbricon commented May 7, 2019

Given this sequence.xsd schema:

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified">
  <xs:element name="root">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="tag"/>
        <xs:element
            name="optional"
            minOccurs="0"
            maxOccurs="2"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

The following xml snippet generates the error: cvc-complex-type.2.4.f: 'optional' can occur a maximum of '2' times in the current sequence. This limit was exceeded. No child element is expected at this point.xml(cvc-complex-type.2.4.f):
`

<?xml version="1.0" encoding="UTF-8" ?>
<root
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="sequence.xsd">
  <tag></tag>
  <optional></optional>
  <optional></optional>
  <optional></optional>
</root>

Screen Shot 2019-05-07 at 3 54 47 PM

The diagnostic rang is wrong though, it should cover the last opening tag.

@fbricon fbricon added bug Something isn't working good first issue Good for newcomers validation XSD labels May 7, 2019
fbricon pushed a commit that referenced this issue May 21, 2019
Fixes #368

Signed-off-by: David Kwon <[email protected]>
@fbricon fbricon added this to the v0.6.0 milestone May 21, 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 good first issue Good for newcomers validation XSD
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant