Ruby and XML, validation and DOM

Hi all,
I’ve started to learn Ruby two days ago and it’s fantastic! :slight_smile:
I need I help, i need a lib to validate a XML file and to create
a DOM tree. I’ve search in the web but I didn’t find anuthing, in truth
I’ve found libxml for tuby but I didn’t find any documentation for the
API…

Thx to all that can halp me

Gendag

On Sun, 18 Dec 2005 13:56:16 -0000, Gendag
[email protected] wrote:

I need I help, i need a lib to validate a XML file and to create
a DOM tree. I’ve search in the web but I didn’t find anuthing, in truth
I’ve found libxml for tuby but I didn’t find any documentation for the
API…

Not that this is much help right now, but I am working on on some basic
documentation for the current libxml codebase. I’ll put it up somewhere
as
an interim measure either today or tomorrow. I’ll post a link when it’s
ready.

On Sunday 18 December 2005 08:57 am, Gendag wrote:

Hi all,
I’ve started to learn Ruby two days ago and it’s fantastic! :slight_smile:
I need I help, i need a lib to validate a XML file and to create
a DOM tree. I’ve search in the web but I didn’t find anuthing, in truth
I’ve found libxml for tuby but I didn’t find any documentation for the
API…

I don’t think it validates, so this may not help, but Rexml is a great
API
for XML parsing, and it comes with Ruby.

On Dec 18, 2005, at 6:57 AM, Gendag wrote:

I’ve started to learn Ruby two days ago and it’s fantastic! :slight_smile:
I need I help, i need a lib to validate a XML file and to create
a DOM tree.

I highly recommend REXML for creating the DOM tree and working with
the XML. But I don’t believe it does DTD/Schema validation.

Thankfully, there seem to be lots of other programs and web services
that do this bit. Although it would be nice to wrap it all up into
one nice little package, how about doing both with separate pieces?

For example, start here http://www.cogsci.ed.ac.uk/~richard/xml-
check.html
If you don’t choose to use that web service, perhaps the software it
links to (or the software that the pages it links to themselves link
to) will help. Remember that Ruby can invoke programs from the shell/
command line, and retrieve the results.

On Sun, 18 Dec 2005 15:04:46 -0000, Ross B.
[email protected] wrote:

documentation for the current libxml codebase. I’ll put it up somewhere
as an interim measure either today or tomorrow. I’ll post a link when
it’s ready.

First cut is up on my site:

http://roscopeco.co.uk/projects/libxml-ruby/

It’s quite basic but it has the all-important ‘what methods does it
have’
thing about it. It covers the last version released by Trans (I think?),
version 0.3.4-04.04.14.

Please be advised that a few bugs have been found:

* Problems with the default validation on XML::Parser (DTD/Schema
  validation should be unaffected)

* Some small memory leaks across the library

* Incompatibilities with GCC 4.0

* Moving nodes between Node/NodeSet operations can cause segfault at
  Ruby exit.

* XPointer/XPath range support is buggy.

However I have the critical stuff patched up here and hopefully we’ll be
able to get an interim release out very soon.

NOTE:
The URL above is temporary, so if you’re reading from archives it’ll
probably be a redirect to libxml on rubyforge. We (or I anyway) just
aren’t quite sure where that is yet ;))

Ross B. wrote:

First cut is up on my site:

http://roscopeco.co.uk/projects/libxml-ruby/

[cut]

I want to thank all for their answers, I’ve tried Rexml and I like
it, but I think it doesn’t validate. Now I’ll read your documentation
to know how libxml for Ruby works, thanks for the link :slight_smile:

bye!

Gendag