Cockatrice / Magic-Token

Tokens.xml for M:tG
The Unlicense
11 stars 15 forks source link

Tokens.xml fails to validate #202

Closed SlightlyCircuitous closed 1 year ago

SlightlyCircuitous commented 1 year ago

When running xmllint --schema ./cards.xsd ./tokens.xml using the current v4 cards.xsd, I receive the following error:

./tokens.xml:7: element cockatrice_carddatabase: Schemas validity error : Element 'cockatrice_carddatabase', attribute '{https://www.w3.org/2001/XMLSchema-instance}noNamespaceSchemaLocation': The attribute '{https://www.w3.org/2001/XMLSchema-instance}noNamespaceSchemaLocation' is not allowed.

Am i doing something wrong or is this an issue of expectations mismatch between cards.xsd and tokens.xml?

I have been simply ignoring this message because I know the xml works fine with that attribute, but it would be nice if the validation tool would tell me everything is OK when I run it with a valid file.

tooomm commented 1 year ago

Try changing https to http in the w3.org URL.

Please also see #65 and especially #93, maybe there are also other linked issues. Also https://github.com/Cockatrice/Cockatrice/pull/3710.

Psithief had concerns there as it looks like the XSD at Cockatrice is not perfect and would need an update to XSD v1.1. Maybe you've some more insights there? Or the situation changed?

SlightlyCircuitous commented 1 year ago

That does actually fix the problem, thank you!

Now that I look at it, both cards.xml and cards.xsd use http and only tokens.xml uses https so I guess it's just the odd one out for some reason. Should we change that in tokens.xml or is it like that for a reason? Alternatively, I guess the xsd could be altered to also accept https as valid.

ebbit1q commented 1 year ago

looking at the history this was introduced in #71

ebbit1q commented 1 year ago

looking at the latest spec it is required to be http, and xmllint is correct in refusing the https url https://www.w3.org/TR/xmlschema11-1/#sec-nss-special

tooomm commented 1 year ago

The URL is fixed since 2 years in #93 (https://github.com/Cockatrice/Magic-Token/pull/93/commits/c73fcaf43d8c309415f794f39ce9d633b0111258), that's why I knew http fixes it. :)

ebbit1q commented 1 year ago

when will #93 be ready for review though?

tooomm commented 1 year ago

I stopped working on it a long time ago, and just updated it from time to time as I like to see such a check at one point. Once #208 is merged, I would update it again. Even as is, it allowed me to spot and fix many issues in the files already and helps to provide a good quality.

Though, the blocker for merging was, that Psithief had concerns and it looked like the XSD at Cockatrice is not perfect and would need an update to XSD v1.1 in order to make the check really be useful? Please feel free to double check, I've no experience with XSD files and XML validation really. Maybe the situation changed or the concerns are not valid (any longer)! --> https://github.com/Cockatrice/Magic-Token/pull/93#issuecomment-711117488