Using a xpath query how do you find if a node (tag) exists at all?
For example if I needed to make sure a website page has the correct basic structure like /html/bod
I work in Ruby and using Nokogiri I fetch the element and look to see if the result is nil.
require 'nokogiri' url = "http://somthing.com/resource" resp = Nokogiri::XML(open(url)) first_name = resp.xpath("/movies/actors/actor[1]/first-name") puts "first-name not found" if first_name.nil?