hihi, can i ask if
how can i filter an Array using ruby?
i have this xml doc with these datas
a
b
c
this is my code
invisibility = XPath.first( doc, “//lm:landmark” )
XPath.each( doc, “//lm:name”) { |element| puts element.text }
names = XPath.match( doc, “//lm:name” )
puts names
so how am i gonna filter out the
and it jus shows me a instead of the tags too? pls i really need help
urgently…
wow thx fred for helping me~~~ i got my things work now!!!
really appreciate ur help!!!
if u don mind can pm me ur contact so i can ask u question if i have
problem??
hehe… if cant its alright~~~
cause im really new to ruby but need to start creating application using
these ruby… ehhe…
anyway thx alot
hloooi
June 3, 2008, 11:28am
4
On Jun 3, 10:01 am, loki ja [email protected] wrote:
invisibility = XPath.first( doc, “//lm:landmark” )
names = XPath.each( doc, “//lm:name”) { |element| puts element.text }
You probably meant something like
names = []
XPath.each ( doc, “//lm:name”) { |element| names << element.text }
In your code the block does nothing apart from output the text - the
return value is just the collection iterated over.
Fred
hloooi
June 3, 2008, 11:01am
5
invisibility = XPath.first( doc, “//lm:landmark” )
names = XPath.each( doc, “//lm:name”) { |element| puts element.text }
puts names
jus split the string is enough… how…~~~
it’s better posting on the mailing list because if someone else has a
similar problem, they may google it and find it.
On Wed, Jun 4, 2008 at 11:10 AM, loki ja
[email protected]
wrote:
cause im really new to ruby but need to start creating application using
these ruby… ehhe…
anyway thx alot
Posted via http://www.ruby-forum.com/ .
–
Appreciated my help?
Recommend me on Working With Rails
http://workingwithrails.com/person/11030-ryan-bigg