doctrine-website icon indicating copy to clipboard operation
doctrine-website copied to clipboard

Mapping XSD - Website Version vs Repo Version

Open internalsystemerror opened this issue 3 years ago • 4 comments

The XSD hosted on the website at https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd is currently being generated from https://github.com/doctrine/doctrine-website/blob/master/source/schemas/orm/doctrine-mapping.xsd. However this differs in some key ways from https://github.com/doctrine/orm/blob/2.9.x/doctrine-mapping.xsd.

Which XSD should be used for validating the XML mappings? As an example, the XSD in this repository requires that elements be ordered (such as <cascade> before <join-columns>) whereas the one hosted on the website does not. (Note: I am using xmllint from libxml2-utils for validation)

Some possibly related issues I found: https://github.com/doctrine/orm/issues/6968 https://github.com/doctrine/orm/pull/6728

internalsystemerror avatar May 27 '21 15:05 internalsystemerror

Which XSD should be used for validating the XML mappings?

The best is ./vendor/doctrine/orm/doctrine-mapping.xsd IMO: it's up to date and it's local.

greg0ire avatar May 27 '21 18:05 greg0ire

Thanks, that's the one I'm currently using. Should the hosted one be versioned and based on the one in here?

internalsystemerror avatar May 28 '21 13:05 internalsystemerror

From https://github.com/doctrine/doctrine-website/issues/92#issue-313909102

It needs to be located here

@jwage hi! What makes you say that? Shouldn't we recommend ./vendor/doctrine/orm/doctrine-mapping.xsd for all intents and purposes? Or are there cases where it would be desirable to use an online versions (situations where Composer is not available but curl is).

I think this is a maintenance burden. Anyway, transferring the issue to the website since it can be generalized to other XSD files.

greg0ire avatar May 28 '21 14:05 greg0ire

@greg0ire It would make more sense than having one xsd-file for every doc-version of ORM. Having a link to the file per version would be a nice-to-have though.

SenseException avatar May 29 '21 20:05 SenseException