xsd2html2xml icon indicating copy to clipboard operation
xsd2html2xml copied to clipboard

maxOccurs on sequence level doesnt make element repeatable

Open journeym opened this issue 4 years ago • 4 comments

maxOccurs on sequence level doesn't make element repeatable, though on element level it does I'm not really an expert on XML structure, just noticed that with one of supplied schemes. Is this intentional, on is that an issue? :)

journeym avatar Jul 02 '21 15:07 journeym

Just to clarify, element is a child of a mentioned sequence

journeym avatar Jul 02 '21 15:07 journeym

If I'm not mistaken, maxOccurs is not allowed on sequence elements according to the XML standard.

MichielCM avatar Jul 05 '21 19:07 MichielCM

I wasn't able to create a simple example, it seems in simple xsd (that doesn't contain references) everything working as intended, and maxOccurs on sequence level is creating repeatable structure. I only have the document I've been working on creating a form for, and it's a bit to complex to analyze.

This is the mentioned xsd file http://ivis.eps.gov.lv/XMLSchemas/100008/eLieta/v1-0/CrimBankExchange.xsd

To create a working form using this application i had to:

  1. Download all the references
  2. Remove annotation block from main xsd CrimBankExchange.xsd
  3. Rewrite ResponseFileStructure and AccountSummaryFileStructure in main XSD with the original from referenced scheme 4. Copy all occurriences of xs:sequence maxOccurs value to below element xs:element

After that, the form seemed to become compliant with xsd

journeym avatar Jul 06 '21 13:07 journeym

If I'm not mistaken, maxOccurs is not allowed on sequence elements according to the XML standard.

minOccurs and maxOccurs are allowed in elements "all", "sequence" and "choise" according to https://www.w3.org/TR/2004/REC-xmlschema-1-20041028/structures.html#element-all

qlobafftar avatar Sep 09 '21 09:09 qlobafftar