git.iko.soy/typeable/xsd-parser
on master help sign in
Initial
77a811dDenis Redozubov
LICENSEnew file+30
@@ -0,0 +1,30 @@
1+Copyright (c) 2019, Denis Redozubov
2+
3+All rights reserved.
4+
5+Redistribution and use in source and binary forms, with or without
6+modification, are permitted provided that the following conditions are met:
7+
8+ * Redistributions of source code must retain the above copyright
9+ notice, this list of conditions and the following disclaimer.
10+
11+ * Redistributions in binary form must reproduce the above
12+ copyright notice, this list of conditions and the following
13+ disclaimer in the documentation and/or other materials provided
14+ with the distribution.
15+
16+ * Neither the name of Denis Redozubov nor the names of other
17+ contributors may be used to endorse or promote products derived
18+ from this software without specific prior written permission.
19+
20+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
src/Text/XSD.hsnew file+6
@@ -0,0 +1,6 @@
1+{-# LANGUAGE TemplateHaskell #-}
2+
3+-- | A subset of XSD specification.
4+module Text.XSD where
5+
6+import Text.XSD.Parser
src/Text/XSD/Internal.hsnew file+17
@@ -0,0 +1,17 @@
1+{-# LANGUAGE TemplateHaskell #-}
2+
3+-- | A subset of XSD specification.
4+module Text.XSD.Internal where
5+
6+import Control.Lens
7+import Data.Text
8+
9+type Attribute = (Text, Text)
10+
11+data Element = Element
12+ { _attrs :: [Attribute]
13+ , _elements :: [Element] }
14+ | Choice Element Element
15+ deriving (Show)
16+
17+makeLenses ''Element
src/Text/XSD/Parser.hsnew file+14
@@ -0,0 +1,14 @@
1+module Text.XSD.Parser where
2+
3+import Control.Exception
4+import Control.Monad
5+import Data.ByteString.Lazy
6+import Text.XML
7+import Text.XSD.Internal as XSD
8+
9+
10+toXsd :: Document -> Either SomeException XSD.Element
11+toXsd = undefined
12+
13+parseXSD :: ParseSettings -> ByteString -> Either SomeException XSD.Element
14+parseXSD ps bs = toXsd =<< parseLBS ps bs
xsd-isogen.cabalnew file+39
@@ -0,0 +1,39 @@
1+cabal-version: 2.4
2+name: xsd-isogen
3+
4+-- The package version. See the Haskell package versioning policy (PVP)
5+-- for standards guiding when and how versions should be incremented.
6+-- https://pvp.haskell.org
7+-- PVP summary: +-+------- breaking API changes
8+-- | | +----- non-breaking API additions
9+-- | | | +--- code changes with no API change
10+version: 0.1.0.0
11+synopsis: XSD representation and xml-isogen description generator from XSD
12+license: BSD-3-Clause
13+license-file: LICENSE
14+author: Denis Redozubov
15+maintainer: denis.redozubov@gmail.com
16+category: Data
17+extra-source-files: CHANGELOG.md
18+
19+
20+library
21+ -- Modules exported by the library.
22+ exposed-modules: Text.XSD
23+ , Text.XSD.Parser
24+ , Text.XSD.Internal
25+
26+ other-extensions: TemplateHaskell
27+
28+ -- Other library packages from which modules are imported.
29+ build-depends: base ^>=4.12.0.0
30+ , bytestring
31+ , lens >= 4.13
32+ , text
33+ , xml-conduit
34+
35+ -- Directories containing source files.
36+ hs-source-dirs: src
37+
38+ -- Base language which the package is written in.
39+ default-language: Haskell2010