One important requirement of some transformation applications is the ability to select some part of the XML documents to be further transformed. The query abstract transformation covers this goal.
It takes as input the source to be queried and the query to be processed against the input. Its output will be the result.
The apply-query element introduces the use of a query in a process body. Its structure is the following:
In order to test this interface we defined a very simple query language that only allows the expression of two elements: query which contains a set of select elements. The select elements have a match attribute containing an XPath [clark1999b] expression. The evaluation of the query will return all the subtrees of the input stream that match one of the select clauses. The conjunction can be implemented by composing two such queries. This is a very light query language which does not transform order or provide complex operations but it is embedded in a rich environment which can provide this.
For instance, the following query asks for all the references involving either Troncy or Brunet as author (in any position).
This simple query language has been implemented by transforming the query element into an XSLT stylesheet that is processed against the input and returns the result
References to contributed extensions can be found here
Next chapter: Rule sets