Open h3xx opened 2 years ago
Shouldn't maxOccurs="unbounded"
be "1"
?
Shouldn't
maxOccurs="unbounded"
be"1"
?
No, maxOccurs="1"
limits it to one element, i.e. EITHER <Title>...</Title>
or <Series>...</Series>
I tried validating
with maxOccurs="1"
and it complains about <Series>
being there even once:
comicinfo.xml:7: element Series: Schemas validity error : Element 'Series': This element is not expected.
But perhaps you're right about <choice>
not being optimal. Let me test if repeated elements work as-expected. Maybe I need to get rid of the <choice>
. Let me test.
I just tested with the your sample xml and it had some errors.
I think i confused the tag. I tested in a random online validator and it did indeed present the error you mention.
This was also discussed in #10
I believe choice is not optimal either.
The <choice> indicator specifies that either one child element or another can occur:
Per w3s this implies that only one would be chosen. At least that's how i understand it.
I just tested with the your sample xml and it had some errors.
Yeah, the document I put in the comment still has some validity issues, but using the XSD in this project, I'm working through them. See my updated PR description for some samples.
So, through some more testing, I find I had some issues with the schema I first pushed.
<sequence>
in current main
doesn't allow BOTH forms of <Series>...</Series><Title>...</Title>
and <Title>...</Title><Series>...</Series>
<option>
in my first push allowed multiple <Title>
elements - this is not correct.I managed to fix both the ordering restriction and the dupe rejection issues in 4c076b16ff6801f15a56ee7d3825ec28444bffad, using <all>
TODO: I want to:
- Help get CI working in order to test this change Edit: Done! (See #30)
- Add a test Edit: Done! (See #30)
- Change the rest of the XSD's to reflect this change Edit: Done!
You can push to main in your fork to run CI that's what i usually do. It does validate btw.
It does validate btw.
The XSD validates, that's great, but I meant something more in-depth, like "here is a ComicInfo.xml file that should validate using the drafts/v2.1/ComicInfo.xsd
schema" and "here is one that should not validate".
Oh that's right i just validate locally so never payed attention to that.
Okay, I brought the change into the main schemas, and wrote a script to run a gauntlet of tests (see #30).
Let the document specify the tags immediately under
<ComicInfo>
in any order, instead of in sequence.The XSD should allow BOTH forms of:
<Series>...</Series><Title>...</Title>
<Title>...</Title><Series>...</Series>
Should validate:
Should not validate:
Closes #10