[Haskell-cafe] ANN: dtd-text DTD parser and renderer, V0.1.1.0

Yitzchak Gale gale at sefer.org
Mon Jun 6 18:56:29 CEST 2011


The dtd-text package[1] provides a parser and renderer for XML
DTDs. It implements most of the parts of the W3C XML specification
relating to DTDs, and is compatible with versions 1.0 and 1.1 of the
specification.[2] The parser and renderer operate on Haskell DTD
objects from the dtd-types[3] package.

The parser is based on the attoparsec-text[4] parser library.

Version 0.1.1.0 adds the first preliminary version of the
renderer, based on the blaze-builder[5] package.

Synopsis:

  -- Parse a DTD without parameter entity resolution.
  -- See the attoparsec-text package for information
  -- about how to use this parser.
  dtd :: Parse DTD

  -- Parse a DTD from a Data.Text.Lazy while resolving
  -- references to internal parameter entities. If you
  -- are not sure which interface to use, use this one.
  dtdParse :: L.Text -> DTD

  -- Parse a DTD from a Data.Text.Lazy while resolving
  -- references to internal and external parameter entities.
  -- Supply the values of the external parameter references
  -- using a SymTable, where type SymTable = M.Map Text L.Text
  dtdParseWithExtern :: SymTable -> L.Text -> DTD

  -- Create a builder to render a DTD.
  -- See the blaze-builder package for information
  -- about how to use this builder.
  buildDTD :: DTD -> Builder

Enjoy,
Yitz

[1] http://hackage.haskell.org/package/dtd-text
[2] http://www.w3.org/TR/2008/REC-xml-20081126/
[3] http://hackage.haskell.org/package/dtd-types
[4] http://hackage.haskell.org/package/attoparsec-text
[5] http://hackage.haskell.org/package/blaze-builder



More information about the Haskell-Cafe mailing list