Project

General

Profile

Bug #14093 ยป bug_script.rb

script to reproduce - jcavalieri (John Cavalieri), 11/08/2017 08:03 PM

 
#!/usr/bin/env ruby

require 'rexml/document'

xml_string = '<a><b><name/></b></a>'
rexml_doc = REXML::Document.new(xml_string)

puts "Considering this xml: "
puts xml_string

puts "\nThe xpath '/a/b/name()' xpath should return the name of element 'a'. Instead it returns the child element 'name'.\n\n"

puts 'Output: '
puts REXML::XPath.first(rexml_doc, '/a/b/name()')

    (1-1/1)