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 <folder>...</folder> can include
<bookmark>...</bookmark> 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
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 <folder>...</folder> can include
<bookmark>...</bookmark> 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
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 <folder>...</folder> can include
> <bookmark>...</bookmark> 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
路路路
From: Henrik Horneber <ryco@gmx.net>
Subject: Re: REXML: Got stuck...
Date: Fri, 10 Sep 2004 20:45:15 +0900
Meino Christian Cramer wrote:
..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... 
James
Meino Christian Cramer wrote:
..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... 
Hi!
When I reread my message a second ago, I realized it is not the kind of answer I would like to receive. Not exactly helpful. 
Sorry!
And thanks James for clearing that up.
Henrik
Hi Henrik,
>>Meino Christian Cramer wrote:
>>
>>> ..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... 
Hi!
When I reread my message a second ago, I realized it is not the kind of
answer I would like to receive. Not exactly helpful. 
Sorry!
No problem at all ! No need to feel sorry! 
And thanks James for clearing that up.
Henrik
Ruby.use!
Meino
路路路
From: Henrik Horneber <ryco@gmx.net>
Subject: Re: REXML: Got stuck...
Date: Sat, 11 Sep 2004 04:13:26 +0900