[plt-scheme] ssax collection and exported symbols in sxpath

From: Karl Pflästerer (sigurd at 12move.de)
Date: Wed Jan 19 06:49:03 EST 2005

Hi,
I have two questions:

(1) Is there a special reason why the file sxpath.ss only provides four
   symbols for public access (nodeset?, node-typeof?, map-union, sxpath)
   but the other also useful functions from sxpath-old.scm like
   `select-kids' or `node-or', `node-closure' etc. can't be used with
   that module?

(2) I use that library to build a texinfo format document from a xml
   file.  What is a good strategy to build the different tables of
   contents (tagged »@menu ... @end menu« in texinfo) and the node
   entries (tagged »@node current node, next node, previous node, up node«)
   At the moment I use `pre-post-order' to number the different levels,
   `sxpath' to extract the numbered levels but I search now a good way
   to build the node entries (I have to know not only the name of the
   current node but also of the next, the previous and the upward node).

Here is a short outline of the document structure:
,----
| (article
|  (section
|   (@ (id "introduction"))
|   (title "Introduction")
|   (para ...)
|   (para ...)
|   .
|   .
|   .)
|  (section
|   (@ (id "FAQ"))
|   (title "Frequently Asked Questions with Answers")
|   (qandaset
|    (qandadiv
|     (title "Installation FAQ")
|     (qandaentry
|      (question (para "What is the latest version of Gnus?"))
|      (answer ...))
|     (qandaentry
|      .
|      .
|      .))
|    (qandadiv
|     (title ...)
|     .
|     .
|     ))))
`----

Every section (well with exceptions) is a @heading in texinfo, every
qandadiv is a @subsection and every question is a @subsubheading.
Questions are numbered (e.g 7.1 which means subsection 7 question 1).
After every @section and @subsection I have to generate a @menu and
before every sectioning command (including @subsubheading) I need a
node.  How could I produce the nodes without too often traversing the
document tree?


   Karl



Posted on the users mailing list.