LibXML-Ruby 0.3.6 is now available from Rubyforge. LibXML-Ruby is (as
you may have guessed) a C-language Ruby binding to the Gnome LibXML2
library, supporting a wide range of XML technologies and offering very
competitive performance across the board.
This release is essentially our ‘ground zero’ release after a recent
effort to revive the sleeping LibXML-Ruby project with the help of
original author Sean C… Although fixes for a number of bugs in
the build and the code are included, no new functionality has yet been
added. We are keen to gain feedback from the community, whether positive
or negative, with a view to fixing the direction of the project. Our
mailing list:
Will this library be renamed LibXML2-Ruby soon? The current name is
slightly misleading.
Yes, I have to agree. But the project was previously under the name
‘libxml-ruby’ and we wanted to get a release out quickly, with minimal
changes (beyond fixing things). This release should be completely
compatible with existing code, including the “require ‘xml/libxml’”
part.
We’re hoping to get feedback from this release and work that into the
next minor release, 0.4.0. Maybe between now and then we can slip a name
change in there …
Will this library be renamed LibXML2-Ruby soon? The current name is
slightly misleading.
Yes, I have to agree. But the project was previously under the name
‘libxml-ruby’ and we wanted to get a release out quickly, with minimal
changes (beyond fixing things). This release should be completely
compatible with existing code, including the “require ‘xml/libxml’”
part.
We’re hoping to get feedback from this release and work that into the
next minor release, 0.4.0. Maybe between now and then we can slip a name
change in there …
Good work! I prefer the API (and, obviously, the speed)
over that of REXML. I do concur about the naming. Either
make it libxml2-ruby or bump the version to 2.3.6
Tried to install it under windows and it failed because I didn’t have Zlib.
This is with the ruby one click installer.
Strange, because ZLib is included in the one-click installer.
Curt
(Wrong button, excuse the noise)
Does it include the zlib.h header ?
If so, OP could maybe try passing --with-zlib= option to a manual
install, but I’m not sure yet how it could work with gems…
On Thursday 23 February 2006 2:32 pm, Ross B. wrote:
LibXML-Ruby 0.3.6 is now available from Rubyforge. LibXML-Ruby is (as
you may have guessed) a C-language Ruby binding to the Gnome LibXML2
library, supporting a wide range of XML technologies and offering
very competitive performance across the board.
This sounds great. Thanks for producing these bindings. I am really
glad to see this as it adds a simple interface for validating against
an xml schema.
Sadly I’ll eventualy need to get this compiled on windows, which I’ve
never had much luck with
i plane to use this binding within a MacOS X application.
for me, including “libxml-ruby” is easy using stadalonift.rb from
Jonathan Paisley, but i wonder on how to embed also the gnome libxml2
correctly bind to ruby…
Could you please explain to us uninitiated the advantages (and
disadvantages) of this over REXML?
I’ll try, but I have to admit I’ve never made serious use of REXML.
I think the main difference really is that REXML is implemented in Ruby,
whereas LibXML-Ruby is a C-language binding to a native library (that
being, somewhat confusingly I must admit, the Gnome LibXML2 library).
The main upshot of this is speed, and supported functionality - most
(though not all) operations are faster with LibXML-Ruby than with REXML,
mainly due to the native implementation, but partly because LibXML2 is
itself pretty quick too. Thanks to it’s place in Gnome, LibXML2 also
allows us to support a range of XML-related technologies that REXML
doesn’t (as far as I’m aware?), including stable support for namespaces,
XPointer, XInclude, catalogues, and more. Obviously full support is
present for XPath, too (as in REXML I think).
Possibly more important than any of that depending on your usage is
validation: LibXML2 (and by extension LibXML-Ruby) fully support DTD
validation, and has some support for XML Schema (not exactly sure on the
current status of this).
I won’t get into any ‘our library is better than your library’
discussions, because it’s not about that - the two are different animals
that happen to share a hunting ground. The reasons for choosing one or
the other come down to a combination of your requirements in terms of
performance, what you need to do with your XML, whether or not you can
compile LibXML2 and extensions on your target platform, and your
personal preference in terms of which API you prefer.
i plane to use this binding within a MacOS X application.
for me, including “libxml-ruby” is easy using stadalonift.rb from
Jonathan Paisley, but i wonder on how to embed also the gnome libxml2
correctly bind to ruby…
do you have some advices for that point ?
I’m afraid I can’t be much help there, I’ve no experience with OSX. I’ve
seen standaloneify.rb but it lost me at “Takes a built RubyCocoa app
bundle (as produced by the Xcode/ProjectBuilder template)…”
I’m afraid I can’t be much help there, I’ve no experience with OSX. I’ve
seen standaloneify.rb but it lost me at “Takes a built RubyCocoa app
bundle (as produced by the Xcode/ProjectBuilder template)…”
even not general advices ?
what i think about that :
make a try apart (in my HOME)
with a fresh ruby, libxml2 and RubyLibxml.
what i have to know is the process of binding that’s to say how your
RubyLibxml find ruby and libxml2, probably this is done at the config
step.
then, i can catch the right parameters to get that binding into my fresh
HOME Ruby and Libxml2 ?
what i have to know is the process of binding that’s to say how your
RubyLibxml find ruby and libxml2, probably this is done at the config
step.
Yes, it’s handled by ext/xml/extconf.rb . The Ruby version you build
against is determined by the Ruby you run that script with. You can pass
in the path to libxml in usual extconf style (–with-xml2-dir or
–with-xml2-lib and --with-xml2-include).
You’ll need to manually run the extconf (rather than relying on the
Rakefile) to pass in those options and then run make as usual.
Yes, it’s handled by ext/xml/extconf.rb . The Ruby version you build
against is determined by the Ruby you run that script with. You can pass
in the path to libxml in usual extconf style (–with-xml2-dir or
–with-xml2-lib and --with-xml2-include).
You’ll need to manually run the extconf (rather than relying on the
Rakefile) to pass in those options and then run make as usual.
OK, fine i’ll give it a try ASAP and let you know.
This sounds great. Thanks for producing these bindings. I am really
glad to see this as it adds a simple interface for validating against
an xml schema.
Sadly I’ll eventualy need to get this compiled on windows, which I’ve
never had much luck with
Hopefully if you have the required libraries it will work, but I have to
admit to not knowing much about compiling stuff on Windows…
One of the things we’re interested in with this release is getting a
handle on cross-platform issues. There have been long-standing OSX
issues which are hopefully now fixed, but with limited hardware/software
for testing it’s really important that we get reports of any problems
from OSX and Windows users.