XsdToHaskell

Text.XML.HaXml.Schema.Environment

Contents

- Build Maps from :
- XSD types become top-level types in Haskell.
- XSD element decls also become top-level types in Haskell.
- Element groups get their own Haskell types too.
- Attributes and attribute groups do not become types, they are
- Resolve element/attribute references by inlining their names.

Synopsis

- data Environment = Environment {
  - env_type :: Map QName (Either SimpleType ComplexType)
  - env_element :: Map QName ElementDecl
  - env_attribute :: Map QName AttributeDecl
  - env_group :: Map QName Group
  - env_attrgroup :: Map QName AttrGroup
  - env_namespace :: Map String String
  - env_extendty :: Map QName [(QName, FilePath)]
  - env_substGrp :: Map QName [(QName, FilePath)]
  - env_typeloc :: Map QName FilePath
  }
- emptyEnv :: Environment
- combineEnv :: Environment -> Environment -> Environment
- mkEnvironment :: FilePath -> Schema -> Environment -> Environment
- gatherImports :: Schema -> [(FilePath, Maybe String)]

# Build Maps from :

# XSD types become top-level types in Haskell.

# XSD element decls also become top-level types in Haskell.

# Element groups get their own Haskell types too.

# Attributes and attribute groups do not become types, they are

# Resolve element/attribute references by inlining their names.

data Environment

Constructors

Environment |

Fields

env_type :: Map QName (Either SimpleType ComplexType)
env_element :: Map QName ElementDecl
env_attribute :: Map QName AttributeDecl
env_group :: Map QName Group
env_attrgroup :: Map QName AttrGroup
env_namespace :: Map String String
env_extendty :: Map QName [(QName, FilePath)]

  supertype -> subtypes

env_substGrp :: Map QName [(QName, FilePath)]

  substitution groups

env_typeloc :: Map QName FilePath

  where type is defined

emptyEnv :: Environment

An empty environment of XSD type mappings.

combineEnv :: Environment -> Environment -> Environment

Combine two environments (e.g. read from different interface files)

mkEnvironment :: FilePath -> Schema -> Environment -> Environment

Build an environment of XSD type mappings from a schema module.

gatherImports :: Schema -> [(FilePath, Maybe String)]

Find all direct module dependencies.