add xsd schema description at xlmns url

Bug #1778550 reported by Wolthera van Hövell tot Westerflier
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Advanced Comic Book Format
Fix Released
Undecided
Unassigned

Bug Description

So, apparantly it is considered good practice to have an XSD file(XML schema file) at the uri for the name space, which then describes the name space.

So I decided to make one of these for the 1.1 spec. I was able to verify that the acbf files I have lying around are appropriately recognised, except for the places my generator is just plain wrong :p

The XSD can also be really useful for implementers, as they can run the files they make through xmllint with this XSD, or the opposite, run files they want to read through a linter and then verify it is a valid acbf xml file before reading it.

Some important things to note:

1. XML really hates capitalization, so "ACBF" is considered invalid while "acbf" is appropriate, similarly, "True" is not considered a valid boolean value, while "true" is.
2. language codes according to XML need to be seperated with "-" and not "_", so "en-US" and "en-us" are valid, while "en_US" is not.

Anyway, the attached file would go to "http://www.acbf.info/xml/acbf/1.1.xsd", while the namespace will point to "http://www.acbf.info/xml/acbf/1.1".

Maybe in the future we can alternative schema declaration files, like dtd, or rng, or even jsonld, but I think the xsd is a good start :)

Revision history for this message
Wolthera van Hövell tot Westerflier (griffinvalley) wrote :
Revision history for this message
Wolthera van Hövell tot Westerflier (griffinvalley) wrote :

And now I only see that there was already a 1.1 xsd, god, am I dumb.

Still though, adding it to the namespace location might be useful :)

Revision history for this message
Wolthera van Hövell tot Westerflier (griffinvalley) wrote :

Also, looking at the xsd, it might be worth it to crib the regexp patterns from my xsd at the end. That way the xsd can verify that the points attribute is correct, or the keywords list or even the hexcolors :)

Revision history for this message
Wolthera van Hövell tot Westerflier (griffinvalley) wrote :

Okay, after some checking and testing:

Keywords doesn't take into account you can have multiple of these elements.

Coverpage has no bgcolor? Odd, but also not mentioned in the spec.

You should probably mention in the spec that officially the elements should be in sequence or change the xsd to use <xs:choice maxOccurs="unbounded"> (which is a bit more lenient about the order).

For the binary content-type it might be an idea to restrict the pattern to "(image|font)\/[\w]+", this would select "image/png" and "font/ttf" and the like, and perhaps discourage/warn people against the weird stuff that can be embedded with base64.

Anyway, I fixed my exporter to be verified, mostly (it already carries some 1.2 stuff, so it complains about that, and of course the keywords stuff is currently non-standard too), so that will be in the 4.1 release that will be out this week :)

Revision history for this message
Robert Kubík (Pastierovič) (just-me) wrote :

Thanks, I'll take a look and update the xsd where needed.

Revision history for this message
Robert Kubík (Pastierovič) (just-me) wrote :

Hi,

I changed sequence to choice, so that the order of elements does not have to be preserved.
Fixed also Keywords limitation, but somehow validator (checked with this one https://www.freeformatter.com/xml-validator-xsd.html) can't properly read this regexp, so I leave it out for now. I added regexp for hexcolor, that one works. Will look into the other regexps later.

Regarding Coverpage, yes, it does not have bgcolor. I didn't think it was needed, but I can add it to 1.2 version if you really want it.

Also found out that I need to do some fixes to ACBF Editor as it does not generate completely valid file at the moment.

Revision history for this message
Robert Kubík (Pastierovič) (just-me) wrote :

And also the xsd is placed at http://www.acbf.info/xml/acbf/1.1.xsd

Revision history for this message
Wolthera van Hövell tot Westerflier (griffinvalley) wrote :

Sorry for the late reply, I had a bad case of real life.

> Regarding Coverpage, yes, it does not have bgcolor. I didn't think it was needed, but I can add it to 1.2 version if you really want it.

Nah, I just thought it was inconsistent. This bug can be closed now :) (Though, that xsd is inacessible to me.)

Revision history for this message
Robert Kubík (Pastierovič) (just-me) wrote :

There were some problems with website, which I resolved now. XSD should be available now too.
Cheers

Changed in acbf:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.