How to validate XML (via an XSD file) in Haskell?
Asked Answered
O

1

7

I am already using HXT for transforming XML. Now I want to validate the input and output against a XSD-file.

HXT only seem to include RELAXNG and DTD validators.

I don't really care to use something else for just validating.

Outgrow answered 10/2, 2013 at 22:42 Comment(2)
possible duplicate of Is there a tool to generate XML picklers in Haskell from an XSD?Henson
@PaulSweatte, how exactly should this be a duplicate? The question you are referencing is about generating algebraic data types and serializers/deserializers from XSDs. Doing so may also involve validation - but it is a completely different topic.Outgrow
S
0

The closest I can think is HaXml and some elbow grease: https://hackage.haskell.org/package/HaXml-1.25.3

In particular, you have tools to parse XSD and to validate DTD. However I don't there's an "out of the box" way to validate XSD -- it could be possible to smash the info you want into their DTD format, or you could replicate their validation logic against the parsed XSD.

At least that's a start...

Sidestep answered 20/2, 2015 at 17:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.