S
Stuart Clarke
Hey all,
I would like to pick your brains about Rexml and how to report from it.
For example, I am reading an XML file using references to each XML tag
like so:
doc.root.each_element("/UserData/List/ItemInfo/Title") {|e|
report.puts "Title: #{e.text}"
}
doc.root.each_element("/UserData/List/ItemInfo/Date") {|e|
report.puts "Date: #{e.text}"
}
The 'report.puts' writes this data out to a CSV file. At present I get a
list of all the titles in the XML file followed a list of the dates.
What I need it to get the side by side in a CSV file like so
Title Date
Item1 20th Jan 2009
Item2 12th Feb 2010
Does anyone have any suggestions on a suitable workflow for this?
Many thanks
I would like to pick your brains about Rexml and how to report from it.
For example, I am reading an XML file using references to each XML tag
like so:
doc.root.each_element("/UserData/List/ItemInfo/Title") {|e|
report.puts "Title: #{e.text}"
}
doc.root.each_element("/UserData/List/ItemInfo/Date") {|e|
report.puts "Date: #{e.text}"
}
The 'report.puts' writes this data out to a CSV file. At present I get a
list of all the titles in the XML file followed a list of the dates.
What I need it to get the side by side in a CSV file like so
Title Date
Item1 20th Jan 2009
Item2 12th Feb 2010
Does anyone have any suggestions on a suitable workflow for this?
Many thanks