MichielCM / xsd2html2xml

Generates plain HTML5 forms from XML schemas (XSDs). Transforms filled-in forms into XML.
MIT License
95 stars 42 forks source link

maxOccurs on sequence level doesnt make element repeatable #45

Open journeym opened 3 years ago

journeym commented 3 years ago

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 commented 3 years ago

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

MichielCM commented 3 years ago

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

journeym commented 3 years ago

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

qlobafftar commented 3 years ago

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