Powerful Xml Analysis with Prolog
Introduction SWI Prolog provides a Prolog-friendly version of Xpath which consists of defining Xpath expressions as Prolog terms . The actual API is documented here . There are a few hurdles which one has to face, coming from using standard Xpath expressions (e.g. with XSLT) and having to transpose them into the Prolog flavor. Having integrated this difference with the standard, one can quickly measure the immense flexibility offered by these Prolog xpath predicates for performing some complex Xml Analysis. Key to this is the possibility to use unification involving some Xml intermediate Node objects, using them as current (local) context nodes, which in Xpath is referred to as the “Axis”. Another concept of Xpath, the NodeSet, can also be covered elegantly by unification. I would like now to showcase this on a small example, using a fictitious tree description, and some imaginary information one would like to extract from it. Resources for ...