Probably a really dumb question...

Subject: Probably a really dumb question...
From: Christopher Walsh <christop@xxxxxxx>
Date: Thu, 1 May 1997 15:21:54 +0000 (GMT)
I think this may be a terribly dull newbie question, but it is
one that is giving me great difficulty, so here goes:
 
I have a document that looks like this:
 
<DOCUMENT>
 <FILENAME>foo.txt
 <FILENAME>bar.txt
</DOCUMENT>
 
And I want to use Jade to output this:
 
<PARA>file1 = foo.txt
<PARA>file2 = bar.txt
<PARA>file1
<PARA>file2
 
My DSSSL lokks like this:
 
(root
 (make-simple-page-sequence))
 
(element DOCUMENT
 (make sequence
  (process-children)
  (!!!output a list of file1, file2, ...!!!)
 )
)
 
(element FILENAME
 (make sequence
  (make formatting-instruction
    data: (
       string-append "<PARA>file"
       (number->string (child-number))
       " = ")
  )
  (process-children)
 )
)
 
My question is: how do I output a list of n file mappings? What do I
put where I currently have  (!!!output a list of file1, file2, ...!!!)?
 
I want to do something like:
 
for x = 1 to number_of_FILENAME_children do
  output "file"+x
 
Or failing that, I want to define an empty string and as I encounter
each FILENAME element, I want to add "<PARA>file(child-number) " to it,
then output this string.
 
I am having great difficulty doing either of these things.
 
I get the feeling I am thinking about the problem in the wrong way.
 
How should I be thinking about the problem?
 
Thanks in advance for any help,
 
Chris

-- 
------------------------------------------------------------------------
 CHRIS WALSH [christop@xxxxxxx] \ "Permissive society?
 Technical Author                \  It doesn't exist. 
 SCO Client Integration Division  \  I should know, I've looked for it."
 Vision Park, Cambridge, UK        \                --Rigsby
------------------------------------------------------------------------

 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread