citation-style-language / csl-validator

Validator for CSL styles and locales
https://validator.citationstyles.org/
MIT License
9 stars 5 forks source link

Validator – "File Upload" gives systematically an error (Non-XML Content-Type: “text/x-csl”.) #6

Closed gracile-fr closed 9 years ago

gracile-fr commented 9 years ago

@rmzelle I tried to validate a style through "File Upload", and got an error : -With the in-house validator ( validator.citationstyles.org/? ) : "Validation failed: Non-XML Content-Type: “text/x-csl”." -With validator.nu, "IO Error: Non-XML Content-Type: text/x-csl."

Thanks

rmzelle commented 9 years ago

Can reproduce the issue, and I'm sure this used to work. Reported upstream: https://github.com/validator/validator/issues/30

rmzelle commented 9 years ago

@gracile-fr, can you test this again? It works for me now.

gracile-fr commented 9 years ago

It doesn't work for me. Same error.

rmzelle commented 9 years ago

@adam3smith, can you give this a try? I can reproduce this on Windows 7, but not on OS X. It seems either intermittent or related to the local setup.

rmzelle commented 9 years ago

Use e.g. https://validator.nu/?doc=https%3A%2F%2Fraw.githubusercontent.com%2Fcitation-style-language%2Fstyles%2Fmaster%2Fapa.csl&schema=https%3A%2F%2Fraw.githubusercontent.com%2Fcitation-style-language%2Fschema%2Fv1.0.1%2Fcsl.rnc&parser=xml&laxtype=yes&showsource=yes and replace the URL by a locale file.

gracile-fr commented 9 years ago

I have this issue on Win7 with both Firefox and chrome. On Ubuntu 12.04 LTS with Firefox, no problem. (re: your comment there validator/validator#30 )

rmzelle commented 9 years ago

@gracile-fr, this should now work at http://validator.citationstyles.org/.

As discussed at https://github.com/validator/validator/issues/30, the Nu HTML Checker now treats all ".csl" files as "application/xml" (https://github.com/validator/validator/commit/46de9bbe5378cf036cbde580018f440b4d89ef8e). Since validator.nu is not updated as often as http://validator.w3.org/nu/, I changed http://validator.citationstyles.org/ to rely on the latter.

Separately, I registered the "application/vnd.citationstyles.style+xml" media type (http://www.iana.org/assignments/media-types/application/vnd.citationstyles.style+xml), which Zotero had already been using for some years (at least in some places) and @dstillman opened a ticket to have Zotero Standalone register ".csl" files as "application/vnd.citationstyles.style+xml" instead of the outdated "text/x-csl" (https://github.com/zotero/zotero-standalone-build/issues/36).

gracile-fr commented 9 years ago

Yes, I had followed the other discussion, thanks !