Forum: Ruby Oddness with gems

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
6d9bf78ca49a017e9e3e6b0357b6c59e?d=identicon&s=25 Peter Hickman (Guest)
on 2008-11-13 10:53
(Received via mailing list)
I am running 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32] and I
installed the libxslt and libxml gems so that I could play with some
xslt. I set up this code:

#!/usr/bin/ruby

require 'rubygems'

require 'libxslt'
require 'libxml'

# Create a new XSL Transform
stylesheet_doc = XML::Document.file('browse.xsl')
stylesheet = LibXSLT::Stylesheet.new(stylesheet_doc)

# Transform a xml document
xml_doc = XML::Document.file('page.xml')
result = stylesheet.apply(xml_doc)

puts result

But when I run it I get uninitialized constant XML (NameError). Any idea
how to go about debugging this?

Sorry I'm being so thick today.
Fbb4d027695dfdf76bf448b15d7e306a?d=identicon&s=25 matt neuburg (Guest)
on 2008-11-13 16:51
(Received via mailing list)
Peter Hickman <peter@semantico.com> wrote:

>
> # Transform a xml document
> xml_doc = XML::Document.file('page.xml')
> result = stylesheet.apply(xml_doc)
>
> puts result
>
> But when I run it I get uninitialized constant XML (NameError). Any idea
> how to go about debugging this?

The namespace changed. It is now called LibXML::XML::Document (and so
on). m.
6d9bf78ca49a017e9e3e6b0357b6c59e?d=identicon&s=25 Peter Hickman (Guest)
on 2008-11-13 16:57
(Received via mailing list)
Ah, thanks for that. Will get on with things now.

Thanks you
This topic is locked and can not be replied to.