Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mgajda/xml-typelift
XML TypeLift will allow to use XML Schema to create Haskell data type and parser for it
https://github.com/mgajda/xml-typelift
haskell type-providers xml-schema
Last synced: 3 months ago
JSON representation
XML TypeLift will allow to use XML Schema to create Haskell data type and parser for it
- Host: GitHub
- URL: https://github.com/mgajda/xml-typelift
- Owner: mgajda
- License: bsd-2-clause
- Created: 2018-03-26T11:24:08.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-03-04T21:26:11.000Z (11 months ago)
- Last Synced: 2024-06-03T21:15:27.785Z (8 months ago)
- Topics: haskell, type-providers, xml-schema
- Language: Haskell
- Size: 818 KB
- Stars: 3
- Watchers: 2
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE
Awesome Lists containing this project
README
# Repository moved to GitLab!!!
Look at: https://gitlab.com/migamake/xml-typelift
# Converting XML Schema to Haskell datatype
GitLab build: [![pipeline status](https://gitlab.com/migamake/xml-typelift/badges/master/pipeline.svg)](https://gitlab.com/migamake/xml-typelift/commits/master)
Travis CI: [![Travis (.org)](https://img.shields.io/travis/mgajda/xml-typelift.svg)](https://travis-ci.org/mgajda/xml-typelift)
XML TypeLift will allow to use XML Schema to create Haskell data type and parser for it.
That will allow us to easily handle large XML Schemas like Office OpenXML made by Microsoft.
It is part of DataHaskell initiative on type providers in Haskell.
## Team
* [Michal](http://github.com/mgajda) - works on this
* [Kevin](http://github.com/dataopt) - made initial explorations in the playground/, now retired from the project.
* [Dima Krylov]() - many contributions, including benchmarks, no longer works on this## How?
* XML Schema parser:
- Xeno.DOM - is much faster than other XML parsers, and pure Haskell
* we added enhanced error reporting as part of the project
* we plan to add the following too:
- namespace support
- XML fragment parsing
* We will use Haskell code generation like [`json-autotype`](http://github.com/mgajda/json-autotype)
* Sample schemas will be put into `test/` directory## `xml-typelift-cli` utility
`xml-typelift-cli` is a CLI to XML Typelift functions. It is allow to generate parser and types for XML files by XML Schema.
To build this utility run
```
stack build xml-typelift:exe:xml-typelift-cli
```You can view supported command line arguments as usual by running `xml-typelift-cli --help` (or using `stack`: `stack run --
`xml-typelift-cli --help`):```
XML Typelift command line interfaceUsage: xml-typelift-cli [--version] --schema FILENAME [--types]
Generates types and parser for XML files by XML schema (.xsd) filesAvailable options:
-h,--help Show this help text
--version Show version
--schema FILENAME Path to XML schema (.xsd file)
--types Generate types only
```So to generate parser for XML Schema `your_schema.xsd` you can run `xml-typelift-cli --schema your_schema.xsd`
and parser and auxiliary types will be output to stdout. Also you can get only types (without parser) by running
`xml-typelift-cli --schema your_schema.xsd --types`.