From: Peter Hickman Date: 2013-03-13T20:03:13+09:00 Subject: Re: ideas on how to determine tag --047d7b66fc190e572e04d7cc5a24 Content-Type: text/plain; charset=ISO-8859-1 Well this works require 'rubygems' require 'nokogiri' xml = '

this is a paragraph

' doc = Nokogiri::XML(xml) node = doc.search("//*[@id='b234567']").first puts node puts node.name Once you have the node then the name method will tell you the element type. NEVER USE A REGEX!!!!! --047d7b66fc190e572e04d7cc5a24 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Well this works

require 'rubyg= ems'
require 'nokogiri'

xml = =3D '<doc><p id=3D"a124">this is a paragraph</= p><ul id=3D"b234567"><li id=3D"a4563">li= st item</li></ul></doc>'
doc =3D Nokogiri::XML(xml)

node =3D doc.searc= h("//*[@id=3D'b234567']").first
puts node
=
puts node.name
= Once you have the node then the name method will tell you the element type.=

NEVER USE A REGEX!!!!!
--047d7b66fc190e572e04d7cc5a24--