From: Ilan Berci Date: 2006-08-24T22:36:34+09:00 Subject: Re: (RE)XML question unknown wrote: > > _Why's Hpricot example worked perfectly for me, BTW. > > So, a related question. > > Suppose I wanted to "nest" macros of this kind. Something like: > > seed-value > today. > > Forgive the nonsense example. > > Could XSLT handle this easily? Could Hpricot (_why)? > > > Thanks, > Hal Yes, both techniques could handle nested elements, I don't know what XML tools you are using, but many come with XSLT support built in. XSLT allows any XML(XHTML) doc to be transformed into any other. At one time it was slated to replace .CSS but that never seeemed to materialize. Now days, it's mostly used in report generation and xml rpc filtering but it ofcourse has many uses. The disadvantages of XSLT is that it can be rather challenging to debug and it can grow to be very verbose in non trivial transformations. The advantage is that it is a W3C standard and practically every platform/language has support for it in one form or another. I have no experience of Hpricot but if you are already using Ruby as your main processor then I would probably stick with Hpricot as the solutions above look much cleaner than an XSLT solution :) Oh.. and lastly, if you don't use XSLT/XPath on a regular basis, you can easily forget it's symantics and have to keep referring back to the docs or at least I have to. ilan -- Posted via http://www.ruby-forum.com/.