Gregory S. wrote:
I haven’t tried this on edge, but I will mention that current stable Rails
actually strips out the / on empty XML tags. For example, if I have
Parenthetically, what’s ?
in a .rhtml file, when it gets to the browser it has become . I hope
this is fixed in edge, but I don’t have time to check.
This gets us close to the FAQ “should I switch to Edge?” The answer is,
as usual, “If you have to ask, you shouldn’t!” Any project should use
that metric as the definition for its Edge version! 
Now here’s why we like XPath. I have a simple assert_xpath that works
like this:
@xdoc = Document.new(someFragment)
assert_xpath ‘//span[@id=“defeat_myspace”]’ do
assert_xpath ‘/img[@src=“goForIt.png”]’
end
The source is below my sig. Currently, I can’t drop an entire
(non-Edge) page into someFragment, so I use assert_tag or assert_select
to extract one, or I get one directly from one of my own
XHTML-generating methods.
The assertion passes a node to the sought path into its block. This
allows the inner block to assert as if all the outer block’s path were
prepended to its own path. So in just a few lines of code I compete
with assert_select(), and blow assert_tag() away.
XPath’s query system is awesome enough to let me embed the = != < >
criteria right into its selection string.
For my next magical trick, I will create an XPath generator that lets
you go assert_xpath.span(:id=>'defeat_myspace) etc. Ruby is at the
forefront of the languages that make dicking with your test rig much
more fun that working on your smegging project! 
–
Phlip
class Test::Unit::TestCase
def assert_xpath(path, &block)
node = XPath.first(@xdoc, path)
assert_not_nil node
was_xdoc = @xdoc
@xdoc = node
block.call(@xdoc) if block
return node
ensure
@xdoc = was_xdoc
end # CONSIDER better diagnostics?
def assert_no_xpath path
node = XPath.first(@xdoc, path)
assert_nil node
end
end