From: Meino Christian Cramer Date: 2004-09-11T01:06:06+09:00 Subject: Re: REXML: Got stuck... From: Henrik Horneber Subject: Re: REXML: Got stuck... Date: Fri, 10 Sep 2004 20:45:15 +0900 > Meino Christian Cramer wrote: > > > Hi Rubyaner ! :) > > > > I want to reorder my bookmarks, a xbel document generated by KDE's > > Konqueror 3.3. with ruby (what else? ;) > > > > The elements are known but they can include each other in a > > unpredictable order: A ... can include > > ... which can include........and so forth. > > > > I want to write a loop which steps down the tree one step deeper (and > > the way back afterwards) at each looping... > > > > My problem: I dont know the nesting depth...and I currently have no > > idea anymore how to achieve the wanted behaviour. > > > > My code snippets either prints the very first level element "xbel" > > and stops then (probably caused by not able to recurse deeper) or > > print the whole bookmarks.xml file at once (only one loop needed > > -- also probably caused by not able to recurse) or print nothing. > > > > Now I get stuck. > > > > Any ideas? Or is there any xbel-parsing module out there? I asked > > ruby forge but it rerturns "nil" ;) > > > > Thank you very much for any help or hint in advance ! > > > > Ruby.use! > > Meino > > Hi! > > This sounds a little bit like what Martin Fowler did with Ruby instead > of XSLT. In short, he uses some Visitor-like approach. Google will help > you find it (I don't have http here right now :( ) > > Hope that helps! > > Henrik > > > Hi Henrik, ..short question: Since I dont know the solution of my problem, I also dont know, of what "parts" it consists. So my question is: What should I feed into Google: "Martin Fowler" and "XSLT"...sonds not very sufficient... Please give me a hint...thanks a lot in advance and sorry for getting stuck again... :) Ruby.use! Meino