# Problems with xslt4r

**URL:** <https://rubytalk.org/t/problems-with-xslt4r/12595>\
**Category:** ruby-talk\
**Created:** [15 July 2004 12:16 UTC](https://rubytalk.org/t/problems-with-xslt4r/12595 "2004-07-15T12:16:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ralf\_Muller](https://avatars.discourse-cdn.com/v4/letter/r/b5ac83/32.png) [@Ralf\_Muller](https://rubytalk.org/u/Ralf_Muller)\
**Post date:** [15 July 2004 12:16 UTC](https://rubytalk.org/t/problems-with-xslt4r/12595/1 "2004-07-15T12:16:39Z")

</div>

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](http://www.fantasy-coders.de/xslt)"\>  
^  
test\_style.xsl:1: parse error  
\<xsl:stylesheet xmlns:xsl="[http://www.fantasy-coders.de/xslt](http://www.fantasy-coders.de/xslt)"\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^

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

---

<div class="post-metadata">

**Author:** ![George5](https://avatars.discourse-cdn.com/v4/letter/g/7c8e57/32.png) [@George5](https://rubytalk.org/u/George5)\
**Post date:** [15 July 2004 12:55 UTC](https://rubytalk.org/t/problems-with-xslt4r/12595/2 "2004-07-15T12:55:38Z")

</div>

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 🙂

try this:

&nbsp;&nbsp;&nbsp;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,

&nbsp;&nbsp;&nbsp;Michael

---

<div class="post-metadata">

**Author:** ![Ralf\_Muller](https://avatars.discourse-cdn.com/v4/letter/r/b5ac83/32.png) [@Ralf\_Muller](https://rubytalk.org/u/Ralf_Muller)\
**Post date:** [15 July 2004 13:13 UTC](https://rubytalk.org/t/problems-with-xslt4r/12595/3 "2004-07-15T13:13:48Z")

</div>

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:
> > 
> > &nbsp;&nbsp;&nbsp;ruby xslt.rb test\_style.xsl test.xml

---

<div class="post-metadata">

**Author:** ![George5](https://avatars.discourse-cdn.com/v4/letter/g/7c8e57/32.png) [@George5](https://rubytalk.org/u/George5)\
**Post date:** [15 July 2004 13:23 UTC](https://rubytalk.org/t/problems-with-xslt4r/12595/4 "2004-07-15T13:23:51Z")

</div>

Ralf Müller wrote:

> **···**
>
> > Am Donnerstag, 15. Juli 2004 14:55 schrieb Michael Neumann:
> > 
> > > try this:
> > > 
> > > &nbsp;&nbsp;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:
> 
> &nbsp;&nbsp;&nbsp;ruby xslt.rb test/stylesheet.xsl test/data.xml
> 
> Regards,
> 
> &nbsp;&nbsp;&nbsp;Michael

---

<div class="post-metadata">

**Author:** ![Ralf\_Muller](https://avatars.discourse-cdn.com/v4/letter/r/b5ac83/32.png) [@Ralf\_Muller](https://rubytalk.org/u/Ralf_Muller)\
**Post date:** [15 July 2004 13:41 UTC](https://rubytalk.org/t/problems-with-xslt4r/12595/5 "2004-07-15T13:41:24Z")

</div>

> try:
> 
> &nbsp;&nbsp;&nbsp;ruby xslt.rb test/stylesheet.xsl test/data.xml

Now, it works fine.

Does xslt4r support different namespaces?

ralf

---

<div class="post-metadata">

**Author:** ![George5](https://avatars.discourse-cdn.com/v4/letter/g/7c8e57/32.png) [@George5](https://rubytalk.org/u/George5)\
**Post date:** [15 July 2004 16:05 UTC](https://rubytalk.org/t/problems-with-xslt4r/12595/6 "2004-07-15T16:05:37Z")

</div>

Ralf Müller wrote:

> > try:
> > 
> > &nbsp;&nbsp;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,

&nbsp;&nbsp;&nbsp;Michael

---

<div class="post-metadata">

**Author:** ![Ralf\_Muller](https://avatars.discourse-cdn.com/v4/letter/r/b5ac83/32.png) [@Ralf\_Muller](https://rubytalk.org/u/Ralf_Muller)\
**Post date:** [16 July 2004 07:21 UTC](https://rubytalk.org/t/problems-with-xslt4r/12595/7 "2004-07-16T07:21:25Z")

</div>

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](https://rubytalk.org/uploads/short-url/A4sdAAZkC7ce1vGTKhPoNi7HNdR.xsl) (2.22 KB)

[lcwa-short.dia.gz](https://rubytalk.org/uploads/short-url/jMwmO27EK3BYvqWEcNGpNpkussT.gz) (2.64 KB)

[lcwa.sql](https://rubytalk.org/uploads/short-url/n2DcKF4Tw6dobFPmA9mbzxMcMu7.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!

---

<div class="post-metadata">

**Author:** ![George5](https://avatars.discourse-cdn.com/v4/letter/g/7c8e57/32.png) [@George5](https://rubytalk.org/u/George5)\
**Post date:** [16 July 2004 16:32 UTC](https://rubytalk.org/t/problems-with-xslt4r/12595/8 "2004-07-16T16:32:13Z")

</div>

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,
> 
> &nbsp;&nbsp;&nbsp;Michael
