Text.XML.HXT.DTDValidation.Validation

hxt-9.3.1.22: A collection of tools for processing XML with Haskell.

Copyright | Copyright (C) 2008 Uwe Schmidt
License | MIT
Maintainer | Uwe Schmidt (uwe@fh-wedel.de)
Stability | experimental
Portability | portable
Safe Haskell | None
Language | Haskell2010

Text.XML.HXT.DTDValidation.Validation

Description

This module provides functions for validating XML documents represented as XmlTree.

Unlike other popular XML validation tools the validation functions return a list of errors instead of aborting after the first error was found.

Note: The validation process has been split into validation and transformation! If `validate` did not report any errors, `transform` should be called, to change the document the way a validating parser is expected to do.

Synopsis

- getDTDSubset :: XmlArrow
- generalEntitiesDefined :: XmlArrow
- validate :: XmlArrow
- validateDTD :: XmlArrow
- validateDoc :: XmlArrow
- removeDoublicateDefs :: XmlArrow
- transform :: XmlArrow

# Documentation

getDTDSubset :: XmlArrow #

generalEntitiesDefined :: XmlArrow #

validate :: XmlArrow #

Main validation filter. Check if the DTD and the document are valid.

- returns : a function which expects a complete document as XmlTree input and returns a list of all errors found.

validateDTD :: XmlArrow #

Check if the DTD is valid.

- returns : a function which expects an XmlTree from the parser as input and returns a list of all errors found in the DTD.

validateDoc :: XmlArrow #

Check if the document corresponds to the given DTD.

- returns : a function which expects a complete document as XmlTree input and returns a list of all errors found in the content part.

removeDoublicateDefs :: XmlArrow #

Removes doublicate declarations from the DTD which first declaration is binding. This is the case for ATTLIST and ENTITY declarations.

- returns : A function that replaces the children of DOCTYPE nodes by a list where all multiple declarations are removed.

transform :: XmlArrow #

filter for transforming a document with respect to the given DTD.

Validating parsers are expected to normalize attribute values and add default values. This function should be called after a successful validation.

- returns : a function which expects a complete XML document tree and returns the transformed XmlTree