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 working #515

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

XSD 1.1 working #515

wants to merge 1 commit into from

Conversation

angelozerr
Copy link
Contributor

@angelozerr angelozerr commented Jul 17, 2019

XSD 1.1 working

Fixes #363

Signed-off-by: azerr azerr@redhat.com

@angelozerr
Copy link
Contributor Author

@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:

  • test with LSPMessageFormatter because there are no test with LSPMessageFormatter
  • test with a sample of validation with XSD 1.1.

If you wish I work today on it, please tell me.

@fbricon
Copy link
Contributor

fbricon commented Jul 17, 2019

@angelozerr tests for 1.1 support are needed indeed

@angelozerr
Copy link
Contributor Author

Ok I will write test today.

@angelozerr angelozerr force-pushed the xsd_1.1 branch 2 times, most recently from b22d800 to 71caa64 Compare July 17, 2019 10:10
@angelozerr
Copy link
Contributor Author

@angelozerr tests for 1.1 support are needed indeed

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:

image

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.

@fbricon
Copy link
Contributor

fbricon commented Jul 17, 2019

please update the feature list in the readme

@angelozerr angelozerr force-pushed the xsd_1.1 branch 4 times, most recently from 2ee7159 to b5418f9 Compare July 17, 2019 20:04
@angelozerr
Copy link
Contributor Author

@fbricon please don't review this PR. There are some trouble with completion.

@angelozerr angelozerr force-pushed the xsd_1.1 branch 5 times, most recently from a72505a to bcb38bb Compare July 18, 2019 15:24
@xorye
Copy link

xorye commented Jul 18, 2019

@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).

@NikolasKomonen
Copy link
Contributor

Also tested with some XSD 1.1 stuff. Works for me as well.

@angelozerr
Copy link
Contributor Author

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.

@angelozerr angelozerr force-pushed the xsd_1.1 branch 4 times, most recently from 60903a8 to bc9a7e5 Compare July 24, 2019 09:20
Fix #363

Signed-off-by: azerr <azerr@redhat.com>
@deathaxe
Copy link

Looks like it needs some work?

@GitMensch
Copy link
Contributor

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:

I'm working on this issue with PR #515 It should be available for 0.8.0

Originally posted by @angelozerr in #363 (comment)

Given the issues mentioned in redhat-developer/vscode-xml#222

@mlocati
Copy link

mlocati commented Nov 22, 2023

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?

@angelozerr
Copy link
Contributor Author

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.

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

@apupier
Copy link
Contributor

apupier commented Nov 22, 2023

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.

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 published one version of xerces-j xsd 1.0
I guess I should have rights to publish another version.
if i remember well I didn't published the 1.1 version published because it was never done before and some specific artifacts for it were missing (and I wasn't able to build locally)

@mlocati
Copy link

mlocati commented Nov 22, 2023

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:

  1. I download the Xerces archive (xsd-1.1 variant) and "install" its jars in the local m2 archive with mvn install:install-file (see here)
  2. I reference those packages in my pom file (see here)
  3. and finally I'm able to use an XSD 1.1 schema (see here).

@mlocati
Copy link

mlocati commented Nov 22, 2023

I wasn't able to build locally

@apupier what about asking the j-dev mailing list?

@apupier
Copy link
Contributor

apupier commented Nov 23, 2023

I wasn't able to build locally

@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.
I also do not have time to look deep into this.
You can find what I documented when i published a version here https://issues.apache.org/jira/browse/XERCESJ-1724 and the mention that there was nothing available for xsd 1.1.

@mlocati
Copy link

mlocati commented Nov 23, 2023

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?

@mickaelistria
Copy link
Contributor

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.
So if lemminx-maven is to use a library that is not published in a Maven repo, then it should consider incuding it in its own Maven repository. As this wouldn't be an official artifact, it should keep the org.eclipse.lemminx groupId.

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.

@mlocati
Copy link

mlocati commented Nov 23, 2023

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'd disagree: Xerces is very stable and mature. The problem is simply that the Xerces team doesn't need to publish on Maven.

@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

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.

@irbian
Copy link

irbian commented Dec 3, 2024

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'."

@apupier
Copy link
Contributor

apupier commented Dec 3, 2024

for reference, the ticket asking for a xerces with xml schema 1.1 https://issues.apache.org/jira/browse/XERCESJ-1736

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

Successfully merging this pull request may close these issues.

Does not support XSD 1.1
10 participants