# File: xslt.c|
[ "README", "AUTHORS", "ChangeLog", "xslt.c", nil].each do
ruby extconf.rb —enable-exslt (on by default) : enables libexslt support <exslt.org/>
ruby extconf.rb —enable-error-handler (off by default) : enables a VERY crude error handler. error messages are appended to the class variable XML::XSLT and can be accessed with the class method XML::XSLT.errors (not very good, but better than trapping $stderr)
XML::XSLT.extFunction("do-this", "fake.none", MyClass)
The callback function will now call the function with the same name as the function that was called. One (possibly confusing) exception is that when you register a function with a ’-’ in it the name of the ruby method called has the ’-’s replaced with ‘_’s. This is because there seems to be a convention of naming XPath functions with hyphens and they’re illegal in Ruby method names.
The big stability change is that the external function table is now stored in a hash of hashes on the XSLT class object. (rather than a global xmlHash) It makes more sense to make it a property of the class and the hashes are an easy way to implement it.
The type of objects that are passed to and returned from extension functions has changed to be more sane. REXML is now required to convert an xmlXPathObj to and from a VALUE; nodesets are passed to Ruby as an array of REXML::Elements and REXML::Elements / REXML::Documents returned from Ruby get turned into nodesets.
xsltCleanupGlobals() shouldn’t be called until we’re done with whatever functions that are registered (probably when our program doesn’t need ruby-xslt at all any more).