On Correcting XML Documents with Respect to a Schema - Archive ouverte HAL Access content directly
Journal Articles The Computer Journal Year : 2014

On Correcting XML Documents with Respect to a Schema


We present an algorithm for the correction of an XML document with respect to schema constraints expressed as a document type definition. Given a well-formed XML document t seen as a tree, a schema S and a non-negative threshold th, the algorithm finds every tree t′ valid with respect to S such that the edit distance between t and t′ is no higher than th. The algorithm is based on a recursive exploration of the finite-state automata representing structural constraints imposed by the schema, as well as on the construction of an edit distance matrix storing edit sequences leading to correction trees. We prove the termination, correctness and completeness of the algorithm, as well as its exponential time complexity. We also perform experimental tests on real-life XML data showing the influence of various input parameters on the execution time and on the number of solutions found. The algorithm's implementation demonstrates polynomial rather than exponential behavior. It has been made public under the GNU LGPL v3 license. As we show in our in-depth discussion of the related work, this is the first full-fledged study of the document-to-schema correction problem.
No file

Dates and versions

hal-00999637 , version 1 (03-06-2014)


  • HAL Id : hal-00999637 , version 1


Joshua Amavi, Béatrice Bouchou, Agata Savary. On Correcting XML Documents with Respect to a Schema. The Computer Journal, 2014, 57 (5), pp.639-674. ⟨hal-00999637⟩
52 View
0 Download


Gmail Facebook X LinkedIn More