# File test/xpath_test.rb, line 316 def test_namespaces_1 source = "\t\t\t<foo xmlns:ts=\"this\" xmlns:tt=\"that\">\n\t\t\t\t<ts:bar>this bar</ts:bar>\n\t\t\t\t<tt:bar>that bar</tt:bar>\n\t\t\t</foo>\n" doc = Document.new source result = XPath.each( doc, "//bar" ) { fail "'bar' should match nothing in this case" } namespace = {"t","this"} results = XPath.first( doc, "//t:bar", namespace ) assert_equal "this bar", results.text end