Parsing with Nokogiri an XML file

guadalupeworm

New Member
\[code\]<DataSet xmlns="http://www.atcomp.cz/webservices"> <xs:schema xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="http://stackoverflow.com/questions/11528374/urn:schemas-microsoft-com:xml-msdata" id="file_mame">...</xs:schema> <diffgr:diffgram xmlns:msdata="http://stackoverflow.com/questions/11528374/urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"> <alldata xmlns=""> <category diffgr:id="category1" msdata:rowOrder="0"> <category_code>P.../category_code> <category_name>...</category_name> <subcategory diffgr:id="subcategory1" msdata:rowOrder="0"> <category_code>...</category_code> <subcategory_code>...</subcategory_code> <subcategory_name>...</subcategory_name> </subcategory>\[/code\]....Could anyone help me, please, how can I obtain all categories and subcategories data?I am trying something like\[code\]reader.xpath('//DataSet/diffgr:diffgram/alldata').each do |node|\[/code\]but this gives me\[code\]undefined method `xpath' for #<Nokogiri::XML::Reader:0x000001021d1750>\[/code\]
 
Back
Top