XML Schema is a well-established mechanism to define the structure and constrain the content of an XML document. While this approach taken by itself is declarative, currently available tools for XML validation are not. In this paper we introduce an implementation of an XSD validator in SWI-Prolog, made publicly available as the package library(xsd). Our approach is based on flattening the XSD and XML documents into Prolog facts. The top-down validation makes great use of Prolog's backtracking and unification capabilities. To ensure the compliance to the XSD standard and to support the test-driven development, we have created a test framework based on the Test Anything Protocol and SWI-Prolog's quasi-quotations.
%0 Conference Paper
%1 nogatz2018declarative
%A Nogatz, Falco
%A Kalkus, Jona
%B Declarative Programming and Knowledge Management
%D 2018
%E Seipel, Dietmar
%E Hanus, Michael
%E Abreu, Salvador
%K myown
%P 187-197
%R 10.1007/978-3-030-00801-7_12
%T Declarative XML Schema Validation with SWI-Prolog
%X XML Schema is a well-established mechanism to define the structure and constrain the content of an XML document. While this approach taken by itself is declarative, currently available tools for XML validation are not. In this paper we introduce an implementation of an XSD validator in SWI-Prolog, made publicly available as the package library(xsd). Our approach is based on flattening the XSD and XML documents into Prolog facts. The top-down validation makes great use of Prolog's backtracking and unification capabilities. To ensure the compliance to the XSD standard and to support the test-driven development, we have created a test framework based on the Test Anything Protocol and SWI-Prolog's quasi-quotations.
%@ 978-3-030-00800-0
@inproceedings{nogatz2018declarative,
abstract = {XML Schema is a well-established mechanism to define the structure and constrain the content of an XML document. While this approach taken by itself is declarative, currently available tools for XML validation are not. In this paper we introduce an implementation of an XSD validator in SWI-Prolog, made publicly available as the package library(xsd). Our approach is based on flattening the XSD and XML documents into Prolog facts. The top-down validation makes great use of Prolog's backtracking and unification capabilities. To ensure the compliance to the XSD standard and to support the test-driven development, we have created a test framework based on the Test Anything Protocol and SWI-Prolog's quasi-quotations.},
added-at = {2018-04-05T18:59:01.000+0200},
author = {Nogatz, Falco and Kalkus, Jona},
biburl = {https://www.bibsonomy.org/bibtex/2ae72ffe40ff0a48c2e61078c8bba265d/falco.nogatz},
booktitle = {Declarative Programming and Knowledge Management},
doi = {10.1007/978-3-030-00801-7_12},
editor = {Seipel, Dietmar and Hanus, Michael and Abreu, Salvador},
interhash = {f7af1bea18c3d45ddfee39f40cd28297},
intrahash = {ae72ffe40ff0a48c2e61078c8bba265d},
isbn = {978-3-030-00800-0},
keywords = {myown},
pages = {187-197},
timestamp = {2018-09-28T12:37:53.000+0200},
title = {Declarative XML Schema Validation with SWI-Prolog},
year = 2018
}