[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

rexml/document problem

Cool Wong

7/20/2007 12:41:00 AM

[code]

<?xml version="1.0"?>
<a>

<b prefix="A" num="1" />
<b perfix="B" num="2" />
<b prefix="C" num="3" />
<b prefix="D" num="4" />
<b prefix="F" num="5" />
</a>
[/code]

This is my xml file data. There include several <b> in the xml file. i
can read the 1st data:

puts root.elements["b"].attributes["prefix"]

Now i cannot read the <b> 1 by 1. How can i read the <b> and write the
output is:

"A"
"B"
"C"
"D"
"E"

--
Posted via http://www.ruby-....

8 Answers

Phlip

7/20/2007 2:06:00 AM

0

Cool Wong wrote:

> <?xml version="1.0"?>
> <a>
>
> <b prefix="A" num="1" />
> <b perfix="B" num="2" />
> <b prefix="C" num="3" />
> <b prefix="D" num="4" />
> <b prefix="F" num="5" />
> </a>
> [/code]
>
> This is my xml file data. There include several <b> in the xml file. i
> can read the 1st data:
>
> puts root.elements["b"].attributes["prefix"]
>
> Now i cannot read the <b> 1 by 1. How can i read the <b> and write the
> output is:
>
> "A"
> "B"
> "C"
> "D"
> "E"

REXML::XPath.each(root, '//b') do |node|
p node.text
end

--
Phlip
http://www.oreilly.com/catalog/9780...
"Test Driven Ajax (on Rails)"
assert_xpath, assert_javascript, & assert_ajax


Cool Wong

7/20/2007 3:54:00 AM

0

Phlip wrote:
> Cool Wong wrote:
>
>>
>> "C"
>> "D"
>> "E"
>
> REXML::XPath.each(root, '//b') do |node|
> p node.text
> end



if i want to update or edit the content in the xml file, how can i
update it??

--
Posted via http://www.ruby-....

Brad Guth

9/16/2010 4:15:00 AM

0

On Sep 15, 6:25 pm, Warhol <mol...@hotmail.com> wrote:
> On Sep 16, 1:13 am, Brad Guth <bradg...@gmail.com> wrote:
>
>
>
> > On Sep 15, 3:11 pm, Warhol <mol...@hotmail.com> wrote:
>
> > > Israel under fire from Gaza...biggest escalation since Operation Cast
> > > Lead.
>
> > > What will the Israeli response be.....operation cast lead 2?http://www.ynetnews.com/articles/0,7340,L-39544...
>
> > > The Jews are setting off fireworks to justify murdering more people.
>
> > > Prove me wrong.
>
> > > And once again...those occupying Palestine are not God's people.
> > > Whether they are Khazar's, Canaanites, or Habiru is irrelevant.
>
> > > Wanton murder of an unarmed people, including the children is
> > > repugnant and will ultimately bring destruction to the perpetrators...
>
> > > How many Jews hurt...none?
>
> > > How many Pali's will be murdered in retaliation?
>
> > > Hundred's?
>
> > > In the mean time...they keep building the illegal settlements on
> > > stolen land.
>
> > > Boy, Hitler had these fuckers pegged, didn't he.
>
> > Not only pegged but also put to good use as his Zionist Nazi goons,
> > plus as his physics and science wizards that got him so advanced and
> > so much further along, on so little.  If Russia had stuck with him,
> > we'd all be speaking German and Jewish to boot.
>
> >  ~ BG
>
> The insanity of humanity is just mind boggling! All this will lead to
> is the near extermination of human beings, just as the prophets
> foretold!

Then I must be a prophet. How about yourself?

Btw; you never did mention how you police your own kind?

~ BG

Warhol

9/16/2010 4:48:00 AM

0

On Sep 16, 6:14 am, Brad Guth <bradg...@gmail.com> wrote:
> On Sep 15, 6:25 pm, Warhol <mol...@hotmail.com> wrote:
>
>
>
> > On Sep 16, 1:13 am, Brad Guth <bradg...@gmail.com> wrote:
>
> > > On Sep 15, 3:11 pm, Warhol <mol...@hotmail.com> wrote:
>
> > > > Israel under fire from Gaza...biggest escalation since Operation Cast
> > > > Lead.
>
> > > > What will the Israeli response be.....operation cast lead 2?http://www.ynetnews.com/articles/0,7340,L-39544...
>
> > > > The Jews are setting off fireworks to justify murdering more people.
>
> > > > Prove me wrong.
>
> > > > And once again...those occupying Palestine are not God's people.
> > > > Whether they are Khazar's, Canaanites, or Habiru is irrelevant.
>
> > > > Wanton murder of an unarmed people, including the children is
> > > > repugnant and will ultimately bring destruction to the perpetrators....
>
> > > > How many Jews hurt...none?
>
> > > > How many Pali's will be murdered in retaliation?
>
> > > > Hundred's?
>
> > > > In the mean time...they keep building the illegal settlements on
> > > > stolen land.
>
> > > > Boy, Hitler had these fuckers pegged, didn't he.
>
> > > Not only pegged but also put to good use as his Zionist Nazi goons,
> > > plus as his physics and science wizards that got him so advanced and
> > > so much further along, on so little.  If Russia had stuck with him,
> > > we'd all be speaking German and Jewish to boot.
>
> > >  ~ BG
>
> > The insanity of humanity is just mind boggling! All this will lead to
> > is the near extermination of human beings, just as the prophets
> > foretold!
>
> Then I must be a prophet.  How about yourself?
>
> Btw;  you never did mention how you police your own kind?
>
>  ~ BG




There remains a long road ahead; there will be continuing challenges
and our work is not done. And yet it is beyond doubt that the gallant
Man, woman who have fought here for the truth deserve to look back on
their efforts with a great sense of professional pride and
accomplishment. Increasingly, the public has come to understand that
something important began to change.

I am The Sheriff... and I follow the Laws of the Republic of the Free
Man Sons... One Law for All man.

"I hope the time is not far off when I shall be able to unite all the
wise and educated men of all the countries and establish a uniform
regime based on the principles of MISBAH which alone are true and
which alone can lead men to happiness." - Napoleon Bonaparte (aka
Ahmed El Capo LEON) as Quoted in Christian Cherfils, 'Bonaparte et
Islam,' Pedone Ed.,
Paris, France, 1914, pp. 105, 125

Brad Guth

9/16/2010 5:02:00 AM

0

On Sep 15, 9:48 pm, Warhol <mol...@hotmail.com> wrote:
> On Sep 16, 6:14 am, Brad Guth <bradg...@gmail.com> wrote:
>
>
>
> > On Sep 15, 6:25 pm, Warhol <mol...@hotmail.com> wrote:
>
> > > On Sep 16, 1:13 am, Brad Guth <bradg...@gmail.com> wrote:
>
> > > > On Sep 15, 3:11 pm, Warhol <mol...@hotmail.com> wrote:
>
> > > > > Israel under fire from Gaza...biggest escalation since Operation Cast
> > > > > Lead.
>
> > > > > What will the Israeli response be.....operation cast lead 2?http://www.ynetnews.com/articles/0,7340,L-39544...
>
> > > > > The Jews are setting off fireworks to justify murdering more people.
>
> > > > > Prove me wrong.
>
> > > > > And once again...those occupying Palestine are not God's people.
> > > > > Whether they are Khazar's, Canaanites, or Habiru is irrelevant.
>
> > > > > Wanton murder of an unarmed people, including the children is
> > > > > repugnant and will ultimately bring destruction to the perpetrators...
>
> > > > > How many Jews hurt...none?
>
> > > > > How many Pali's will be murdered in retaliation?
>
> > > > > Hundred's?
>
> > > > > In the mean time...they keep building the illegal settlements on
> > > > > stolen land.
>
> > > > > Boy, Hitler had these fuckers pegged, didn't he.
>
> > > > Not only pegged but also put to good use as his Zionist Nazi goons,
> > > > plus as his physics and science wizards that got him so advanced and
> > > > so much further along, on so little.  If Russia had stuck with him,
> > > > we'd all be speaking German and Jewish to boot.
>
> > > >  ~ BG
>
> > > The insanity of humanity is just mind boggling! All this will lead to
> > > is the near extermination of human beings, just as the prophets
> > > foretold!
>
> > Then I must be a prophet.  How about yourself?
>
> > Btw;  you never did mention how you police your own kind?
>
> >  ~ BG
>
> There remains a long road ahead; there will be continuing challenges
> and our work is not done. And yet it is beyond doubt that the gallant
> Man, woman who have fought here for the truth deserve to look back on
> their efforts with a great sense of professional pride and
> accomplishment. Increasingly, the public has come to understand that
> something important began to change.
>
> I am The Sheriff... and I follow the Laws of the Republic of the Free
> Man Sons... One Law for All man.
>
> "I hope the time is not far off when I shall be able to unite all the
> wise and educated men of all the countries and establish a uniform
> regime based on the principles of MISBAH which alone are true and
> which alone can lead men to happiness." - Napoleon Bonaparte (aka
> Ahmed El Capo LEON) as Quoted in Christian Cherfils, 'Bonaparte et
> Islam,' Pedone Ed.,
> Paris, France, 1914, pp. 105, 125

Good luck with that and the immortal life it'll require of yourself.
Does your family tree have a bloodline of immortality?

~ BG

Warhol

9/16/2010 5:23:00 AM

0

On Sep 16, 7:02 am, Brad Guth <bradg...@gmail.com> wrote:
> On Sep 15, 9:48 pm, Warhol <mol...@hotmail.com> wrote:
>
>
>
> > On Sep 16, 6:14 am, Brad Guth <bradg...@gmail.com> wrote:
>
> > > On Sep 15, 6:25 pm, Warhol <mol...@hotmail.com> wrote:
>
> > > > On Sep 16, 1:13 am, Brad Guth <bradg...@gmail.com> wrote:
>
> > > > > On Sep 15, 3:11 pm, Warhol <mol...@hotmail.com> wrote:
>
> > > > > > Israel under fire from Gaza...biggest escalation since Operation Cast
> > > > > > Lead.
>
> > > > > > What will the Israeli response be.....operation cast lead 2?http://www.ynetnews.com/articles/0,7340,L-39544...
>
> > > > > > The Jews are setting off fireworks to justify murdering more people.
>
> > > > > > Prove me wrong.
>
> > > > > > And once again...those occupying Palestine are not God's people.
> > > > > > Whether they are Khazar's, Canaanites, or Habiru is irrelevant.
>
> > > > > > Wanton murder of an unarmed people, including the children is
> > > > > > repugnant and will ultimately bring destruction to the perpetrators...
>
> > > > > > How many Jews hurt...none?
>
> > > > > > How many Pali's will be murdered in retaliation?
>
> > > > > > Hundred's?
>
> > > > > > In the mean time...they keep building the illegal settlements on
> > > > > > stolen land.
>
> > > > > > Boy, Hitler had these fuckers pegged, didn't he.
>
> > > > > Not only pegged but also put to good use as his Zionist Nazi goons,
> > > > > plus as his physics and science wizards that got him so advanced and
> > > > > so much further along, on so little.  If Russia had stuck with him,
> > > > > we'd all be speaking German and Jewish to boot.
>
> > > > >  ~ BG
>
> > > > The insanity of humanity is just mind boggling! All this will lead to
> > > > is the near extermination of human beings, just as the prophets
> > > > foretold!
>
> > > Then I must be a prophet.  How about yourself?
>
> > > Btw;  you never did mention how you police your own kind?
>
> > >  ~ BG
>
> > There remains a long road ahead; there will be continuing challenges
> > and our work is not done. And yet it is beyond doubt that the gallant
> > Man, woman who have fought here for the truth deserve to look back on
> > their efforts with a great sense of professional pride and
> > accomplishment. Increasingly, the public has come to understand that
> > something important began to change.
>
> > I am The Sheriff... and I follow the Laws of the Republic of the Free
> > Man Sons... One Law for All man.
>
> > "I hope the time is not far off when I shall be able to unite all the
> > wise and educated men of all the countries and establish a uniform
> > regime based on the principles of MISBAH which alone are true and
> > which alone can lead men to happiness." - Napoleon Bonaparte (aka
> > Ahmed El Capo LEON) as Quoted in Christian Cherfils, 'Bonaparte et
> > Islam,' Pedone Ed.,
> > Paris, France, 1914, pp. 105, 125
>
> Good luck with that and the immortal life it'll require of yourself.
> Does your family tree have a bloodline of immortality?
>
>  ~ BG



Warhol

9/16/2010 5:29:00 AM

0

On Sep 16, 7:02 am, Brad Guth <bradg...@gmail.com> wrote:
> On Sep 15, 9:48 pm, Warhol <mol...@hotmail.com> wrote:
>
>
>
> > On Sep 16, 6:14 am, Brad Guth <bradg...@gmail.com> wrote:
>
> > > On Sep 15, 6:25 pm, Warhol <mol...@hotmail.com> wrote:
>
> > > > On Sep 16, 1:13 am, Brad Guth <bradg...@gmail.com> wrote:
>
> > > > > On Sep 15, 3:11 pm, Warhol <mol...@hotmail.com> wrote:
>
> > > > > > Israel under fire from Gaza...biggest escalation since Operation Cast
> > > > > > Lead.
>
> > > > > > What will the Israeli response be.....operation cast lead 2?http://www.ynetnews.com/articles/0,7340,L-39544...
>
> > > > > > The Jews are setting off fireworks to justify murdering more people.
>
> > > > > > Prove me wrong.
>
> > > > > > And once again...those occupying Palestine are not God's people.
> > > > > > Whether they are Khazar's, Canaanites, or Habiru is irrelevant.
>
> > > > > > Wanton murder of an unarmed people, including the children is
> > > > > > repugnant and will ultimately bring destruction to the perpetrators...
>
> > > > > > How many Jews hurt...none?
>
> > > > > > How many Pali's will be murdered in retaliation?
>
> > > > > > Hundred's?
>
> > > > > > In the mean time...they keep building the illegal settlements on
> > > > > > stolen land.
>
> > > > > > Boy, Hitler had these fuckers pegged, didn't he.
>
> > > > > Not only pegged but also put to good use as his Zionist Nazi goons,
> > > > > plus as his physics and science wizards that got him so advanced and
> > > > > so much further along, on so little.  If Russia had stuck with him,
> > > > > we'd all be speaking German and Jewish to boot.
>
> > > > >  ~ BG
>
> > > > The insanity of humanity is just mind boggling! All this will lead to
> > > > is the near extermination of human beings, just as the prophets
> > > > foretold!
>
> > > Then I must be a prophet.  How about yourself?
>
> > > Btw;  you never did mention how you police your own kind?
>
> > >  ~ BG
>
> > There remains a long road ahead; there will be continuing challenges
> > and our work is not done. And yet it is beyond doubt that the gallant
> > Man, woman who have fought here for the truth deserve to look back on
> > their efforts with a great sense of professional pride and
> > accomplishment. Increasingly, the public has come to understand that
> > something important began to change.
>
> > I am The Sheriff... and I follow the Laws of the Republic of the Free
> > Man Sons... One Law for All man.
>
> > "I hope the time is not far off when I shall be able to unite all the
> > wise and educated men of all the countries and establish a uniform
> > regime based on the principles of MISBAH which alone are true and
> > which alone can lead men to happiness." - Napoleon Bonaparte (aka
> > Ahmed El Capo LEON) as Quoted in Christian Cherfils, 'Bonaparte et
> > Islam,' Pedone Ed.,
> > Paris, France, 1914, pp. 105, 125
>
> Good luck with that and the immortal life it'll require of yourself.
> Does your family tree have a bloodline of immortality?
>
>  ~ BG


I have the Kemetic Bloodline... In alchemy , the spiritus mercurii
that lives in the tree.



American

9/16/2010 2:34:00 PM

0

On Sep 16, 1:28 am, Warhol <mol...@hotmail.com> wrote:
> On Sep 16, 7:02 am, Brad Guth <bradg...@gmail.com> wrote:
>
>
>
> > On Sep 15, 9:48 pm, Warhol <mol...@hotmail.com> wrote:
>
> > > On Sep 16, 6:14 am, Brad Guth <bradg...@gmail.com> wrote:
>
> > > > On Sep 15, 6:25 pm, Warhol <mol...@hotmail.com> wrote:
>
> > > > > On Sep 16, 1:13 am, Brad Guth <bradg...@gmail.com> wrote:
>
> > > > > > On Sep 15, 3:11 pm, Warhol <mol...@hotmail.com> wrote:
>
> > > > > > > Israel under fire from Gaza...biggest escalation since Operation Cast
> > > > > > > Lead.
>
> > > > > > > What will the Israeli response be.....operation cast lead 2?http://www.ynetnews.com/articles/0,7340,L-39544...
>
> > > > > > > The Jews are setting off fireworks to justify murdering more people.
>
> > > > > > > Prove me wrong.
>
> > > > > > > And once again...those occupying Palestine are not God's people.
> > > > > > > Whether they are Khazar's, Canaanites, or Habiru is irrelevant.
>
> > > > > > > Wanton murder of an unarmed people, including the children is
> > > > > > > repugnant and will ultimately bring destruction to the perpetrators...
>
> > > > > > > How many Jews hurt...none?
>
> > > > > > > How many Pali's will be murdered in retaliation?
>
> > > > > > > Hundred's?
>
> > > > > > > In the mean time...they keep building the illegal settlements on
> > > > > > > stolen land.
>
> > > > > > > Boy, Hitler had these fuckers pegged, didn't he.
>
> > > > > > Not only pegged but also put to good use as his Zionist Nazi goons,
> > > > > > plus as his physics and science wizards that got him so advanced and
> > > > > > so much further along, on so little.  If Russia had stuck with him,
> > > > > > we'd all be speaking German and Jewish to boot.
>
> > > > > >  ~ BG
>
> > > > > The insanity of humanity is just mind boggling! All this will lead to
> > > > > is the near extermination of human beings, just as the prophets
> > > > > foretold!
>
> > > > Then I must be a prophet.  How about yourself?
>
> > > > Btw;  you never did mention how you police your own kind?
>
> > > >  ~ BG
>
> > > There remains a long road ahead; there will be continuing challenges
> > > and our work is not done. And yet it is beyond doubt that the gallant
> > > Man, woman who have fought here for the truth deserve to look back on
> > > their efforts with a great sense of professional pride and
> > > accomplishment. Increasingly, the public has come to understand that
> > > something important began to change.
>
> > > I am The Sheriff... and I follow the Laws of the Republic of the Free
> > > Man Sons... One Law for All man.
>
> > > "I hope the time is not far off when I shall be able to unite all the
> > > wise and educated men of all the countries and establish a uniform
> > > regime based on the principles of MISBAH which alone are true and
> > > which alone can lead men to happiness." - Napoleon Bonaparte (aka
> > > Ahmed El Capo LEON) as Quoted in Christian Cherfils, 'Bonaparte et
> > > Islam,' Pedone Ed.,
> > > Paris, France, 1914, pp. 105, 125
>
> > Good luck with that and the immortal life it'll require of yourself.
> > Does your family tree have a bloodline of immortality?
>
> >  ~ BG
>
> I have the Kemetic Bloodline... In alchemy , the spiritus mercurii
> that lives in the tree.

The Israeli air strike came as a result of the Gaza militants
firing at least 12 rockets into Israel. It has been known for
quite some time that Hamas has been smuggling weapons
throughout a network of tunnels from Egypt, Syria,
and elsewhere into Gaza.

The bombs dropped by the IAF must have been the
"bunker buster" type, since all the victims were
tunnel workers.

Why do the gun-running Palestinians get ~$600M "humani-
tarian aid" from the USA, ~$500M from Israel, ~$300M from
the EU, ~$100M/mo. extortion money (for Hamas), $$??
arm sales from Darfur, as well as ~$1.5B in PLO donations,
not to mention $drug-trafficking$ and other "peaceful" aid?

The lust for blood has reached an all time high, in order to
intimidate the "ruling powers" by fear, and while it is peace
that will always just seem to be out of reach responsibly,
it is the weapons themselves that are being used to bribe,
extort, and blackmail those with money and power through-
out a real dirty capitalist (black market?) economy.

There has to be a reason why the IAF (Israeli Air Force)
becomes "insinuated" for the recent attacks in Gaza;
Maybe it has something to do with how the power of the
illegal markets are all doing dirty deeds, in order to keep
not only the Palestinians occupied with weapons, but
create the illusion that "its because of Jihad" as the ultimate
cover for the (illegal) markets themselves.

American

"He dines with the brass because no one trusts him
with the silver."