Popularity
3.3
Declining
Activity
0.0
Stable
2
3
0

Monthly Downloads: 10
Programming language: Haskell
License: LicenseRef-PublicDomain
Tags: XML     Test     Hxt     QuickCheck     Relaxng    

quickcheck-relaxng alternatives and similar packages

Based on the "Test" category.
Alternatively, view quickcheck-relaxng alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of quickcheck-relaxng or a related project?

Add another 'Test' Package

README

quickcheck-relaxng

This module exports a matchingRNG function that turns a RelaxNG pattern into a QuickCheck generator for XML documents matching that pattern.

For example, given a book.rng schema file:

<grammar xmlns="http://relaxng.org/ns/structure/1.0"
         datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <start><element name="book" xmlns="http://relaxng.org/ns/structure/1.0">
    <oneOrMore><element name="author"><data type="string">
      <param name="pattern">[-a-z0-9._%][email protected][-a-z0-9.]+\.[a-z]{3,18}\.(asia|eu|today)</param>
    </data></element></oneOrMore>
  </element></start>
</grammar>

We can generate a random XmlTree conforming to it:

>>> import Test.QuickCheck.RelaxNG (loadRNG, matchingRNG, showXmlTree)
>>> import Test.QuickCheck (generate)
>>> putStr . showXmlTree =<< generate . matchingRNG =<< loadRNG "book.rng"
<?xml version="1.0" encoding="UTF-8"?>
<book>
  <author>[email protected]</author>
  <author>[email protected]</author>
  <author>[email protected]</author>
</book>

CC0 1.0 Universal

To the extent possible under law, 唐鳳 has waived all copyright and related or neighboring rights to quickcheck-relaxng.

This work is published from Taiwan.

http://creativecommons.org/publicdomain/zero/1.0