From: Ronald Fischer Date: 2007-07-12T22:58:01+09:00 Subject: XML file processing using REXML (beginner's question) Hello! I try to understand REXML using the tutorial in http://www.germane-software.com/software/rexml/docs/tutorial.html However, I have problems applying the path expressions to my application. Consider for example the following program, and in particular the last line: #!/usr/bin/ruby require "rexml/document" require 'pp' source=< ENDXML doc=REXML::Document.new source doc.elements.each("ns:toplevel/ns:request") { |element| puts element.attributes["requestID"] } root=doc.root pp root.elements["ns:toplevel/ns:request[@requestID='2']"] The program outputs 1 2 nil that is, it finds the two elements "request" and correctly outputs their attribute requestID, but when I try to locate request number two with the path expression ns:toplevel/ns:request[@requestID='2'] it is not found. What am I doing wrong here? Ronald -- Ronald Fischer Phone: +49-89-452133-162