From: David Mitchell Date: 2005-07-08T14:13:17+09:00 Subject: Re: Ruby in XML. I hate to break this to you John, but the link you posted is to a blank wiki page. Perhaps you got the wrong link? The page http://www.rubygarden.org/ruby?RubyInXML doesn't exist. Yes, you end up with a hairy state machine, but it doesn't mean you lose the one-line StreamParser. Cheers David John Carter wrote: > On Fri, 8 Jul 2005, David Mitchell wrote: > >> Ok, I don't think the example I posted falls outside the bounds of >> simple. Maybe it makes your script a little more complicated but not >> the syntax that the end user must use. I suspect if you hold off the >> actual evaluation of the comments until the page is output then you >> might find this task simpler. > > > I guess where I started was I wanted to loop on the rows of a table. > > > > > > > > >
> #{i} - > > #{i} >
> > > But then I'm holding all kind of state and what happens if I want to > iterate over the columns of the table as well? (Nested loops.) > > > > > > > > > > > >
> #{i} - > > #{i*10 + j} >
> > > I'm then operating a fairly hairy state machine in my Listener class or > I'm no longer using the one (longish) line StreamParser. > > However, if anyone gets the urge to embellish what I have done, as I > say, that's what Wiki's are for. > > > > > > John Carter Phone : (64)(3) 358 6639 > Tait Electronics Fax : (64)(3) 359 4632 > PO Box 1645 Christchurch Email : john.carter@tait.co.nz > New Zealand > > Carter's Clarification of Murphy's Law. > > "Things only ever go right so that they may go more spectacularly wrong > later." > >> From this principle, all of life and physics may be deduced. > > > > -- David Mitchell Software Engineer Telogis