{'fraction_non_alphanumeric': 0.01601423487544484, 'fraction_numerical': 0.0, 'mean_word_length': 4.898601398601398, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
XML Processing in Logic Programming

The main goal of this thesis is to develop a new approach to XML processing based in Logic Programming by exploring the natural tree structure of data in the Logic Programming paradigm and new forms of unification. In particular our aim is to focus on the following issues: • Study an alternative form of unification more appropriate to XML processing. • Study appropriate type systems suitable for both XML and to the alternative form of unification. • Creation of a new programming language for XML processing based on the topics above and its use in the implementation of real-world applications. XML processing in Logic Programming is usually done by traditional list processing or alternatively by translating documents into terms. In both approaches the programmer must process the whole document instead of focusing in the parts that matter. Also there is noway to use the schemas associated with the documents for verification of programs. The contributions of this work are: • A new approach to XML processing based in unification and pattern matching of terms with flexible arity. This led to a new programming language (here named XCentric). • Definition of algorithms which use types (schemas) in the unification process in order to verify the correction of the results. • Development of a simple API based on the concepts above to enable an easy access to parts of documents in depth and translation between different representations. • Application of the language to website verification, where the simple and expressive programs that can be defined in XCentric can be used to impose constraints on websites and correct several errors.