From: Edgard Riba Date: 2006-02-02T05:32:06+09:00 Subject: Template language similar to examples... Hi, I would like to process a text file which contains property-tokens which are replaced appropiately by the template processing library. Property-tokens can be single value, or can be collection of values. The format I would like to use is something like this (the specific characters used to signal might be different): #!This is a comment #DECLARE(%myProperty) #!Here I declare a property (variable) for #!use within the template #DECLARE(%myCollection),MULTI #!This would be an array collection #SET(%mySymbol,1) #!assign a value of 1 #ADD(%myCollection,'A') #!add something to the collection #ADD(%myCollection,'B') #!add something to the collection #ADD(%myCollection,'C') #!add something to the collection #!The code that goes below goes straight into the output, #!except that it takes into account how the #IF is evaluated. class myTestClass def initialize #IF(%mySymbol = 1) @msg = 'Test1' #ELSE @msg = 'Test2' #ENDIF #INSERT(%myTemplateProcedure,%myCollection) end end #GROUP(%myTemplateProcedure,%pCollection) #!For this example, the code below generates: #! @msgA = 'A' #! @msgB = 'B' #! @msgC = 'C' #!Not very useful, but serves as an example of the things I'm looking for. #FOR(%myCollection) @msg%myCollection = '%myCollection' #ENDFOR The output would be: class myTestClass def initialize @msg = 'Test1' @msgA = 'A' @msgB = 'B' @msgC = 'C' end end Are any of you guys familiar with a library that will do something similar to the above? Thanks, Edgard -- Posted via http://www.ruby-forum.com/.