Problems with xslt4r

Hi,

I'd like to use 'xslt4r', because i cannot install libxml2 + libxslt for
libxslt (ruby).
But i get theses errors when invoking xpath from 'xmlscan':

ram@lilith:~/src/xml$irb
irb(main):001:0> require 'xpath'
/usr/local/lib/ruby/site_ruby/1.8/xpath.rb:10: warning: Object#type is
deprecated; use Object#class
=> true
irb(main):002:0>

and if i try to apply the sheet on the test-data:

ram@lilith:~/src/tar/xslt4r-0.0.2/test$ls
data.xml stylesheet.xsl stylesheet2.xsl test.xml test_style.xsl
ram@lilith:~/src/tar/xslt4r-0.0.2/test$ruby -rxslt test_style.xsl test.xml
/usr/local/lib/ruby/site_ruby/1.8/xpath.rb:10: warning: Object#type is
deprecated; use Object#class
test_style.xsl:1: parse error
<xsl:stylesheet xmlns:xsl="http://www.fantasy-coders.de/xslt">
^
test_style.xsl:1: parse error
<xsl:stylesheet xmlns:xsl="http://www.fantasy-coders.de/xslt">
                     ^

with:
ram@lilith:~/src/tar/xslt4r-0.0.2/test$ruby -v
ruby 1.8.2 (2004-05-26) [i686-linux]

is this version of xslt4r to old?
Anyway, does anyone know an easy way to apply stylesheets with ruby without
having libxml, libxslt(C-Lib) installed?

regards
ralf

Ralf Müller wrote:

Hi,

I'd like to use 'xslt4r', because i cannot install libxml2 + libxslt for libxslt (ruby).
But i get theses errors when invoking xpath from 'xmlscan':

ram@lilith:~/src/xml$irb
irb(main):001:0> require 'xpath'
/usr/local/lib/ruby/site_ruby/1.8/xpath.rb:10: warning: Object#type is deprecated; use Object#class

This is only a warning. It's easy to fix. Every occurence of type (not as local variable) should be replaced by self.class.

=> true
irb(main):002:0>

and if i try to apply the sheet on the test-data:

ram@lilith:~/src/tar/xslt4r-0.0.2/test$ls
data.xml stylesheet.xsl stylesheet2.xsl test.xml test_style.xsl
ram@lilith:~/src/tar/xslt4r-0.0.2/test$ruby -rxslt test_style.xsl test.xml
/usr/local/lib/ruby/site_ruby/1.8/xpath.rb:10: warning: Object#type is deprecated; use Object#class
test_style.xsl:1: parse error

aha.... you're trying to run a XSLT file as Ruby code :slight_smile:

try this:

   ruby xslt.rb test_style.xsl test.xml

is this version of xslt4r to old?

it's quite old and uncomplete!

Anyway, does anyone know an easy way to apply stylesheets with ruby without having libxml, libxslt(C-Lib) installed?

Regards,

   Michael

I did and with type -> class replacement, i get no more errors. But i also get
no output.
I'm not sure about, what should be produced. How can I get te result of the
stylesheet-application?

thanks
ralf

···

Am Donnerstag, 15. Juli 2004 14:55 schrieb Michael Neumann:

try this:

   ruby xslt.rb test_style.xsl test.xml

Ralf Müller wrote:

···

Am Donnerstag, 15. Juli 2004 14:55 schrieb Michael Neumann:

try this:

  ruby xslt.rb test_style.xsl test.xml

I did and with type -> class replacement, i get no more errors. But i also get no output. I'm not sure about, what should be produced. How can I get te result of the stylesheet-application

should be printed on stdout.

try:

   ruby xslt.rb test/stylesheet.xsl test/data.xml

Regards,

   Michael

try:

   ruby xslt.rb test/stylesheet.xsl test/data.xml

Now, it works fine.

Does xslt4r support different namespaces?

ralf

Ralf Müller wrote:

try:

  ruby xslt.rb test/stylesheet.xsl test/data.xml

Now, it works fine.

Does xslt4r support different namespaces?

can you give a short example?

xslt4r is in an alpha-stage. the last update was at the end of 2001!

Regards,

   Michael

I want to apply 'lcwa2sql.xsl' on 'lcwa-short.dia'. Using xsltproc from
libxslt, i get 'lcwa.sql'. But 'ruby xslt.rb lcwa2sql.xsl lcwa-short.dia'
produces no output.
I actually need a way to apply the stylesheets without upgrading our
production system to libxml and libxslt. And because of my growing addiction
to ruby, i came accross xslt4r.

maytheforcebewithyou
ralf

lcwa2sql.xsl (2.22 KB)

lcwa-short.dia.gz (2.64 KB)

lcwa.sql (1.75 KB)

···

Am Donnerstag, 15. Juli 2004 18:05 schrieb Michael Neumann:

can you give a short example?

xslt4r is in an alpha-stage. the last update was at the end of 2001!

Ralf Müller wrote:

···

Am Donnerstag, 15. Juli 2004 18:05 schrieb Michael Neumann:

can you give a short example?

xslt4r is in an alpha-stage. the last update was at the end of 2001!

I want to apply 'lcwa2sql.xsl' on 'lcwa-short.dia'. Using xsltproc from libxslt, i get 'lcwa.sql'. But 'ruby xslt.rb lcwa2sql.xsl lcwa-short.dia' produces no output.
I actually need a way to apply the stylesheets without upgrading our production system to libxml and libxslt. And because of my growing addiction to ruby, i came accross xslt4r.

sorry, but I no more develop xslt4r. it was just a proof of concept hack (at a boring weekend).

regards,

   Michael