@@ -82,8 +82,10 @@ toElem cursor = do
82 name <- attrThrowXsd "name" el
82 name <- attrThrowXsd "name" el
83 $ "Expected attribute 'name' for element: " <> show (node cursor)
83 $ "Expected attribute 'name' for element: " <> show (node cursor)
85+ -- https://www.w3.org/TR/xmlschema-1/#cElement_Declarations
86+ -- https://www.w3.org/TR/xmlschema-1/#declare-element
85− minOc = maybe 0 (read . T.unpack) (M.lookup "minOccurs" attrs)
87+ minOc = maybe 1 (read . T.unpack) (M.lookup "minOccurs" attrs)
86− maxOc = read . T.unpack <$> M.lookup "maxOccurs" attrs
88+ maxOc = maybe 1 (read . T.unpack) (M.lookup "maxOccurs" attrs)
87 datatypeRef <- case mAttrType of
89 datatypeRef <- case mAttrType of
88 Just dtn -> pure $ DatatypeRef dtn
90 Just dtn -> pure $ DatatypeRef dtn
89 Nothing -> do
91 Nothing -> do