The Modular DocBook Stylesheets | ||
---|---|---|
Prev | DSSSL Library | Next |
(string-list-sosofo string-list assoc-list)
Take a list of strings and an associative list that maps strings to sosofos and return an appended sosofo.
(This function is used for a particular task in the DocBook stylesheets. It may not be particularly general, but its in dblib.dsl' because there is nothing DTD-specific about it.)
Given the string list ("what is " "1" " " "+" " " "1") and the associative list (("1" (literal "one")) ("2" (literal "two")) ("+" (literal "plus"))), (string-list-sosofo) returns the sequence of sosofos equivalent to (literal "what is one plus one").
Norman Walsh, <norm@berkshire.net>
(define (string-list-sosofo string-list assoc-list) ;; Build sosofo from a list of strings and an associative list (if (null? string-list) (empty-sosofo) (sosofo-append (match-substitute-sosofo (car string-list) assoc-list) (string-list-sosofo (cdr string-list) assoc-list))))
Prev | Home | Next |
string->list | Up | string-replace-list |
Copyright © 1997, 1998 Norman Walsh