TTXPath logo
The MORPH transformation
Flexible Querying for XML
Curtis Dyreson
  Contact me

The primary transformation in XMorph is a MORPH, which transforms the data to a specified shape. A shape is given using the syntax parent [ child1 ... childn ], where each child could itslef have children. Below is an example of a MORPH transformation.

List titles and names by author:
MORPH author [ title name ]
To run the tutorial queries, use the demo code.

The transformation lists the titles written by each author extracted from a collection of book data. The shape specifies that <title> and <name> elements are placed as children of <author> elements. Only <title> and <name> elements that are closest to an <author> element are placed within that <author>. The notion of closeness, which forms the core semantics for XMorph, is explained in the XMorph publications, but intuitively the idea is that authors are closely related to the titles of their own books and articles (and their own names), but not close to titles written by others (or the names of others).

List titles by name:
MORPH name [ title ]
To run the tutorial queries, use the demo code.

Reshape data:
MORPH price [ publisher [ book ] ]
To run the tutorial queries, use the demo code.


Curtis E. Dyreson © 2013. All rights reserved.
  E-mail questions or comments to Curtis.Dyreson at