hxt-7.5: A collection of tools for processing XML with Haskell.ContentsIndex
Text.XML.HXT.RelaxNG.Validator
Description
This module exports the core functions from the basic validation und simplification libraries. It also exports some helper functions for easier access to the validation functionality.
Synopsis
validateDocumentWithRelaxSchema :: Attributes -> String -> IOStateArrow s XmlTree XmlTree
validateDocumentWithRelax :: XmlTree -> IOSArrow XmlTree XmlTree
validate :: Attributes -> String -> String -> IOSArrow n XmlTree
validateSchema :: Attributes -> String -> IOSArrow n XmlTree
validateWithSpezification :: Attributes -> String -> String -> IOSArrow XmlTree XmlTree
validateSchemaWithSpezification :: Attributes -> String -> IOSArrow XmlTree XmlTree
validateWithoutSpezification :: Attributes -> String -> String -> IOSArrow n XmlTree
module Text.XML.HXT.RelaxNG.Validation
module Text.XML.HXT.RelaxNG.Simplification
Documentation
validateDocumentWithRelaxSchema :: Attributes -> String -> IOStateArrow s XmlTree XmlTree

validate a document with a Relax NG schema

  • 1.parameter : the option list for validation
  • 2.parameter : the URI of the Relax NG Schema
  • arrow-input : the document to be validated, namespaces must have been processed
  • arrow-output : the input document, or in case of validation errors, an empty document with status information in the root

options evaluated by validateDocumentWithRelaxSchema:

all other options are propagated to the read functions for schema input

example:

 validateDocumentWithRelaxSchema [(a_check_restrictions, "0")] "testSchema.rng"
validateDocumentWithRelax :: XmlTree -> IOSArrow XmlTree XmlTree

validate an XML document with respect to a Relax NG schema

  • 1.parameter : the valid and simplified schema as XML tree
  • arrow-input : the document to be validated
  • arrow-output : the validated and unchanged document or the empty document with status information set in the root node
validate :: Attributes -> String -> String -> IOSArrow n XmlTree

normalize a document for Relax NG validation, call the validateRelax function for doing the hard work, and issue errors

  • 1.parameter : the arrow for computing the schema
  • arrow-input : the document to be validated
  • arrow-output : nothing

Document validation

Validates a xml document with respect to a Relax NG schema.

First, the schema is validated with respect to the Relax NG Spezification. If no error is found, the xml document is validated with respect to the schema.

  • 1.parameter : list of options; namespace progagation is always done
  • 2.parameter : XML document
  • 3.parameter : Relax NG schema file

available options:

example:

 validate [(a_do_not_check_restrictions, "1")] "test.xml" "testSchema.rng"
validateSchema :: Attributes -> String -> IOSArrow n XmlTree

Relax NG schema validation

Validates a Relax NG schema with respect to the Relax NG Spezification.

  • 1.parameter : list of available options (see also: validate)
  • 2.parameter : Relax NG schema file
validateWithSpezification :: Attributes -> String -> String -> IOSArrow XmlTree XmlTree

Document validation

Validates a xml document with respect to a Relax NG schema. Similar to validate, but the Relax NG Specification is not created. Can be used, to check a list of documents more efficiently.

  • 1.parameter : list of available options (see also: validate)
  • 2.parameter : XML document
  • 3.parameter : Relax NG schema file
  • arrow-input : Relax NG Specification in simple form

example:

 Text.XML.HXT.RelaxNG.Schema.relaxSchemaArrow
 >>>
 ( validateWithSpezification [] "foo.xml" "foo.rng"
   &&&
   validateWithSpezification [] "bar.xml" "bar.rng"
 )
validateSchemaWithSpezification :: Attributes -> String -> IOSArrow XmlTree XmlTree

Relax NG schema validation

see validateSchema and validateWithSpezification

  • 1.parameter : list of available options (see also: validate)
  • 2.parameter : Relax NG schema file
  • arrow-input : Relax NG Specification in simple form
validateWithoutSpezification :: Attributes -> String -> String -> IOSArrow n XmlTree

Document validation

Validates a xml document with respect to a Relax NG schema, but the schema is not validated with respect to a specification first. Should be used only for valid Relax NG schemes.

  • 1.parameter : list of available options (see also: validate)
  • 2.parameter : XML document
  • 3.parameter : Relax NG schema file
module Text.XML.HXT.RelaxNG.Validation
module Text.XML.HXT.RelaxNG.Simplification
Produced by Haddock version 2.1.0