-
Notifications
You must be signed in to change notification settings - Fork 93
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 working #515
base: main
Are you sure you want to change the base?
XSD 1.1 working #515
Conversation
@fbricon I fixed the OutOfMemory with XSD 1.1 which was a problem coming from LSP4XML (an infinite loop). All tests work. If you are OK to merge it, it misses tests:
If you wish I work today on it, please tell me. |
@angelozerr tests for 1.1 support are needed indeed |
Ok I will write test today. |
b22d800
to
71caa64
Compare
Done. To test this PR, create you a xsd file like this: <?xml version="1.0" encoding="UTF-8"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:t="test"
xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
targetNamespace="test"
elementFormDefault="qualified"
vc:minVersion="1.0">
<xs:complexType name="testType">
<xs:all>
<xs:element name="testEle" minOccurs="1" maxOccurs="unbounded" type="xs:string"/>
<xs:element name="testEleTwo" type="xs:string"/>
</xs:all>
</xs:complexType>
</xs:schema> It's XSD 1.0, you should see the following error: After that change vc:minVersion attribute with 1.1 like this: <?xml version="1.0" encoding="UTF-8"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:t="test"
xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
targetNamespace="test"
elementFormDefault="qualified"
vc:minVersion="1.0">
<xs:complexType name="testType">
<xs:all>
<xs:element name="testEle" minOccurs="1" maxOccurs="unbounded" type="xs:string"/>
<xs:element name="testEleTwo" type="xs:string"/>
</xs:all>
</xs:complexType>
</xs:schema> The error should gone. |
please update the feature list in the readme |
2ee7159
to
b5418f9
Compare
@fbricon please don't review this PR. There are some trouble with completion. |
a72505a
to
bcb38bb
Compare
@angelozerr Validation with the example you provided works on my end. I also briefly tested validation with some XSD 1.1 specific features found here: https://blogs.oracle.com/rammenon/xml-schema-11-ndash-what-you-need-to-know and it seems to work correctly (although I am not too knowledgable about XSD). |
Also tested with some XSD 1.1 stuff. Works for me as well. |
Thank's for your feedback @NikolasKomonen. I need to finish to write tests to accept this PR and if @fbricon is OK. |
60903a8
to
bc9a7e5
Compare
Fix #363 Signed-off-by: azerr <azerr@redhat.com>
Looks like it needs some work? |
Could anyone with write access try to fix the conflicts allowing others to test it (for example in the redhat XML plugin)? It seems the following is far away:
Originally posted by @angelozerr in #363 (comment) Given the issues mentioned in redhat-developer/vscode-xml#222 |
So, the reason for holding this PR on is that there isn't a Xerces-with-xsd1.1 version published on Maven, right? If so, I've contacted the Xerces-J maintainers, and they answered that they won't publish on Maven, but can accept volunteers that do that. I'm not very familiar with Maven: is there anyone that wants to do that? |
If I remember @apupier wanted to do that (not sure), but we would like to avoid publishing a non official Xerces XSD 1.1 maven project |
"wanted" is a bit too strong ;-) |
I managed to use the "xsd-1.1" variant of Xerces with Maven without much problems: see https://github.com/concrete5-community/concrete-cif In particular, here's what I do in order to achieve that: |
@apupier what about asking the j-dev mailing list? |
This is anyway not a good way. I should not build an artifact locally and publish it myself. The build needs to be done from a trusted place. |
Publishing to Maven seems rather complicated. But... is it really necessary? Can't we simply install xerces in the local m2 repository like I do in my project? |
lemminx-maven is mainly distributed and built as a Maven artifact. Any dependency to a library that is not available in a Maven repository would make it impossible to consume transitively from Maven, because of the missing transitive dependency. But overall, the fact that the artifact is not published on Maven with regular Xerces can be interpreted as a sign of immaturity, and do we want lemminx to build on top immature blocks? I don't think we should aim at a workaround in lemminx, instead, effort should be invested in xerces project directly to make the bundle available. @mlocati As you seem to need it most, you should be the one getting in touch with the xerces support channels and leading the effort of getting the artifact published to Maven. Then we could just use it in lemminx without extra burden. |
I'd disagree: Xerces is very stable and mature. The problem is simply that the Xerces team doesn't need to publish on Maven.
I play with Java only occasionally, I wouldn't call me an expert: it'd me much better if this task could be done by someone more skilled than be. And Maven is an absolute obscure thing for me. |
Hey, just wondering if it has been any advance regarding this, that I understand is the root of why XSLT 3.0 files fail to validate on Eclipse with the message "There are '45' errors in 'schema-for-xslt30.xsd'." |
for reference, the ticket asking for a xerces with xml schema 1.1 https://issues.apache.org/jira/browse/XERCESJ-1736 |
XSD 1.1 working
Fixes #363
Signed-off-by: azerr azerr@redhat.com