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

XSD 1.1 - cannot validate with conditions #783

Open
tutucek7 opened this issue Oct 10, 2022 · 4 comments
Open

XSD 1.1 - cannot validate with conditions #783

tutucek7 opened this issue Oct 10, 2022 · 4 comments

Comments

@tutucek7
Copy link

tutucek7 commented Oct 10, 2022

Hello, I'm trying to use conditions in my XSD, because of different tags in elements.

<xs:element name="a" maxOccurs="unbounded">
<xs:alternative test="@type = 1" type="a1Type"/>
<xs:alternative test="@type = 1" type="a2Type"/>
</xs:element>
<xs:complexType name="a1Type">
<xs:sequence>
<xs:element name="name" />
<xs:element name="surname" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="a2Type">
<xs:sequence>
<xs:element name="name" />
<xs:element name="id" />
</xs:sequence>
</xs:complexType>

When i will drop that to W3C validator, it's valid. But in VS code with your extension not. It says this: s4s-elt-must-match.1: The content of 'a' must match (annotation?, (simpleType | complexType)?, (unique | key | keyref)*)). A problem was found starting at: alternative.

@angelozerr
Copy link
Contributor

I think it is because we use Xerces which cannot support XSD 1.1.

@tutucek7
Copy link
Author

tutucek7 commented Oct 10, 2022

I think it is because we use Xerces which cannot support XSD 1.1.

So is there anything what can we do?

@angelozerr
Copy link
Contributor

I worked long time ago to support XSD 1.1 in eclipse-lemminx/lemminx#515 but it is uses a non official Xerces version, I fear that there is no solution for the moment while Xerces doens't support XSD 1.1.

@tutucek7
Copy link
Author

Thank you very much, have a nice day 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants