comicinfo icon indicating copy to clipboard operation
comicinfo copied to clipboard

Replace `xs:sequence` by `xs:all`

Open gotson opened this issue 3 years ago • 4 comments

Someone on Discord (i think @therobbiedavis) brought up the point that the current elements are contained in a xs:sequence.

The sequence would mean that (source):

The sequence element specifies that the child elements must appear in a sequence

  • First, this doesn't really make sense from a domain perspective.
  • Second, most consuming applications probably ignore that.

@ajslater brought up that we could replace it with xs:all, which represents an unordered list. It has an additional constraint in XSD 1.0 of limiting elements to 0 or 1 occurrence, but all the elements in the existing schema already have minOccurs="0" maxOccurs="1", so that's fine.

This would make the validation of the XML using the XSD schema easier, where it would probably throw errors if elements are out of order.

gotson avatar Jan 21 '22 06:01 gotson

@ajslater @majora2007 would you confirm whether your respective parsers ignore the order of the elements? Komga doesn't care for sure.

gotson avatar Jan 21 '22 06:01 gotson

My parser doesn't pay attention to element order when reading comicinfo.xml.

ajslater avatar Jan 21 '22 07:01 ajslater

Kavita also does not pay attention to element order.

majora2007 avatar Jan 21 '22 15:01 majora2007

Also why ComicPageType is defined as axs:list when a page can be only of one type?

IngBertolini avatar Sep 30 '22 16:09 IngBertolini