On Wed, Apr 02, 2003 at 08:25:49PM +0200, Stefano Mazzocchi wrote: <snip interesting stuff>
> IMHO, the template language which is closer to the optimum is XSLT but > only with one change: ... > then we can have the following templatesheet: > > namespace ("ns") { > "http://whatever" > } > > template ("/") { > <html> > <head> > <title>{list/@name}</title> > </head> > <body> > <form action="{flow::continuation/id}"> > <table> > attribute ("width") { > if ({deli:screen-width}) { > {deli:screen-width} > } else { > "100%" > } > } > apply-templates > </table> > </form> > </body> > </html> > } > > template ("item") { > <tr> > <td> > if ({ns:subitem}) { > if ({count(ns:subitem}) > 1) { > for-each ({ns:subitem}) { > <span style="color:green">{.}</span> > } > } else { > <span style="color:red">{.}</span> > } > } else if ({request::lang} == [EMAIL PROTECTED] > || {request:://cookie/lang} == [EMAIL PROTECTED]) { > {.} > } else { > "unknown language \"" [EMAIL PROTECTED] "\"" > } > </td> > </tr> > } It sounds odd, but I think XQuery could be a good language for generating XML in this way. It's pretty close to what you've written here. http://www.xml.com/lpt/a/2002/12/23/xquery.html Pity about losing the declarative processing model. There's also JSL ("Jelly Stylesheet Language" I presume), which does the job pretty well in Maven. --Jeff > > Stefano. >