(=> (q 'surname) (create-down (step-to-parent (step-to-parent (current-match))) (subtree-spec add: '((type el) (gi "au")))) 1) (=> (q 'author) '() 1) ;; Doesn't handle case where content of surname is empty. (=> (children (q 'fname)) (create-preced (step-to-first-surname-child) (copy-current)) 1) (define (step-to-first-surname-child) (node-set->node (first (children (select-match (children (parent (current-match))) 'surname))))) (=> (q 'fname) '() 1) (=> (q 'email) (create-follow (step-to-parent (step-to-parent (current-match))) (subtree-spec add: '((type el) (gi "para")) children: (string->subtree-spec-list "Electronic address: " 'ignore)) output-path: (lambda (book) (select-match (children book) 'au))) 1) (define (string->subtree-spec-list str label) (map (lambda (ch) (subtree-spec add: `((type ch) (char ,ch)) label: label)) (string->list str))) (=> (everything) (default-transform output-dtd))