Ticket #112 (closed defect: worksforme)
getting local-name using xpath results in error
| Reported by: | geersing | Owned by: | ser |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.1.8 |
| Component: | XPath | Version: | 3.1.4 |
| Severity: | normal | Keywords: | |
| Cc: | Ruby version: | 1.8.5 | |
| Operating system: | Linux |
Description
Trying the following code:
>> xml="<Inspiratiepost xmlns=\"test\"><Publiek/></Inspiratiepost>" => "<Inspiratiepost xmlns=\"test\"><Publiek/></Inspiratiepost>" >> doc = REXML::Document.new(xml) => <UNDEFINED> ... </> >> REXML::XPath.match(doc.root,"local-name(//Publiek/ancestor::*)")
Result in error:
NoMethodError: undefined method `namespace' for [<Inspiratiepost xmlns='test'> ... </>]:Array
from /usr/local/lib/ruby/1.8/rexml/functions.rb:70:in `get_namespace'
from /usr/local/lib/ruby/1.8/rexml/functions.rb:50:in `local_name'
from /usr/local/lib/ruby/1.8/rexml/xpath_parser.rb:447:in `expr'
from (irb):34:in `each_with_index'
from /usr/local/lib/ruby/1.8/rexml/xpath_parser.rb:434:in `expr'
from /usr/local/lib/ruby/1.8/rexml/xpath_parser.rb:125:in `match'
from /usr/local/lib/ruby/1.8/rexml/xpath_parser.rb:56:in `parse'
from /usr/local/lib/ruby/1.8/rexml/xpath.rb:63:in `match'
from (irb):34
Should return:
=> ["Inspiratiepost"]
Change History
Note: See
TracTickets for help on using
tickets.
