From: Saleem Vighio Date: 2010-12-15T23:22:14+09:00 Subject: xml parsing in ruby Hi, I am very new to ruby language and have problem in xml parsing in ruby. Please help. The problem is to parse an xml file(xmlfile.xml) in ruby that should generate a code which should look like as under: typedef int[0,2] StateTC; const StateTC TC_ACTIVE = 0; const StateTC TC_COMPLETING = 1; const StateTC TC_ENDED = 2; StateTC stTC = TC_ACTIVE; typedef int[0,2] StateP; const StateP P_ACTIVE = 0; const StateP P_COMPLETING = 1; const StateP P_ENDED = 2; StateP stP = P_ACTIVE; typedef int[0,1] MsgsTC; const MsgsTC PREPARE_TC = 0; bool msgsTc[MsgsTC]; typedef int[0,1] MsgsP; const MsgsP COMPLETE_P = 0; bool msgsP[MsgsP]; I attach 2 files: xmlfile(source file), and rubyfile(my try) . Can you please help me in writing ruby code that generates output as shown above from xmlfile. Thanks in advance. Regards, Saleem Attachments: http://www.ruby-forum.com/attachment/5555/xmlfile.xml http://www.ruby-forum.com/attachment/5556/rubyfile.rb -- Posted via http://www.ruby-forum.com/.