Manipulating semistructured data, such as XML, does not t well within conventional programming languages. A typical manipulation requires nding all occurrences of a structure matching a structured search pattern, whose context may be di erent in di erent places, and both aspects cause di culty. If a special-purpose query language is used to manipulate XML, an interface to a more general programming environment is required, and this interface typically creates runtime overhead for type conversion. However, adding XML manipulation to a general-purpose programming language has proven di cult because of problems associated with expressiveness and typing. We show an alternative approach that handles many kinds of patterns within an existing strongly-typed general-purpose programming language called bondi. The key ideas are to express complex search patterns as structures of simple patterns, pass these complex patterns as parameters to generic data-processing functions and traverse heteroge...
F. Y. Huang, C. B. Jay, David B. Skillicorn