lemminx icon indicating copy to clipboard operation
lemminx copied to clipboard

XSD 1.1 working

Open angelozerr opened this issue 6 years ago • 22 comments

XSD 1.1 working

Fixes #363

Signed-off-by: azerr [email protected]

angelozerr avatar Jul 17 '19 04:07 angelozerr

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

angelozerr avatar Jul 17 '19 04:07 angelozerr

@angelozerr tests for 1.1 support are needed indeed

fbricon avatar Jul 17 '19 07:07 fbricon

Ok I will write test today.

angelozerr avatar Jul 17 '19 08:07 angelozerr

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

angelozerr avatar Jul 17 '19 10:07 angelozerr

please update the feature list in the readme

fbricon avatar Jul 17 '19 12:07 fbricon

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

angelozerr avatar Jul 18 '19 07:07 angelozerr

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

xorye avatar Jul 18 '19 15:07 xorye

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

NikolasKomonen avatar Jul 18 '19 19:07 NikolasKomonen

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 avatar Jul 18 '19 19:07 angelozerr

Looks like it needs some work?

deathaxe avatar Oct 13 '20 16:10 deathaxe

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 https://github.com/angelozerr/lsp4xml/pull/515 It should be available for 0.8.0

Originally posted by @angelozerr in https://github.com/eclipse/lemminx/issues/363#issuecomment-512193756

Given the issues mentioned in https://github.com/redhat-developer/vscode-xml/issues/222

GitMensch avatar Jun 28 '21 09:06 GitMensch