Oddness with gems

P

Peter Hickman

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.
 
M

matt neuburg

Peter Hickman said:
#!/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?

The namespace changed. It is now called LibXML::XML::Document (and so
on). m.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top