Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] building a dynamic path to elements in block

From: null_dev::yahoo::com at: 1-Nov-2000 15:12

hi, I've been reverse engineering a large collection of html docs into xml and I've come across a problem that I just can't seem to get my head around in REBOL. I've got a block that looks something like this [ [ id div-title1 div-title2 line-or-paragraph-number language ] [ ..... as above ] .... any number ] for example [ [ 1999.01.0161 book=O poem=1 line=1 Greek] [ 1999.01.0162 book=O poem=1 line=1 English ] ] the number of div-titles varies from document to document, but I want to dynamically grab them when rebuilding the xml.doc. Here's a stripped down bit of test code: ******code starts here******* div-count: ( length? structure-block/1 ) - 3 for count 2 ( div-count + 1 ) 1 [ temp-path: join 'structure-block/1["/"count] to-path temp-path print temp-path ] ******code ends here********** It gives me something like this *****example output****** 1999.01.0161 book=O poem=1 line=1 Greek / 2 1999.01.0161 book=O poem=1 line=1 Greek / 3 *****example output ends here****** whereas I was expecting something like *****example output****** book=O poem=1 *****example output ends here****** I've driven myself crazy trying variations of join, rejoin, reform, to-path, to-lit-path, any clues as to where my reasoning is getting screwed up would be appreciated. Thanks Gary