Projects

Ticket #239 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

NSXML classes cannot be modified properly

Reported by: kourge@… Owned by: lsansonetti@…
Priority: major Milestone: MacRuby 0.5
Component: MacRuby Keywords:
Cc: kourge@…

Description

It would appear that NSXML Cocoa classes (such as NSXMLDocument and NSXMLNode) can be opened properly, but modifications made to them fail silently.

Example:

>> doc = NSXMLDocument.alloc.initWithXMLString "<root></root>", options: 0, error: nil
=> #<NSXMLDocument:0x800634d60>
>> doc.nodesForXPath("root", error: nil)
=> [#<NSXMLElement:0x800634de0>]
>> doc.nodesForXPath("root", error: nil)[0].XMLString
=> "<root></root>"
>> class NSXMLDocument
>> def find(path); self.nodesForXPath(path, error: nil); end
>> end
=> nil
>> doc.find "root"
NoMethodError: undefined method `find' for #<NSXMLDocument:0x800634d60>
	from (irb):7
	from /usr/local/bin/macirb:12:in `<main>'
>>

Change History

Changed 3 years ago by kourge@…

  • cc kourge@… added

Cc Me!

Changed 2 years ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to fixed
  • milestone changed from MacRuby 0.4 to MacRuby 0.5

Seems to be fixed in trunk.

$ cat t.rb 
doc = NSXMLDocument.alloc.initWithXMLString "<root></root>", options: 0, error: nil
doc.nodesForXPath("root", error: nil)
doc.nodesForXPath("root", error: nil)[0].XMLString
class NSXMLDocument
def find(path); self.nodesForXPath(path, error: nil); end
end

p doc.find "root"
$ ./miniruby  t.rb 
[#<NSXMLElement:0x2000241a0>]
Note: See TracTickets for help on using tickets.