XML/XSLT processors - XSLT4R not working? 
Author Message
 XML/XSLT processors - XSLT4R not working?

I'm looking for a pure Ruby XSLT processor.  Stumbled across XSLT4R.  
It looks promising, but it doesn't seem to work even for the test.xslt
in its test directory.  I'd appreciate some recommendations in XSLT
processor for Ruby.  Is there anything in Ruby similar to JAXP in Java?

Thanks
Chris "the XSLT newbie who would rather program in Ruby"



Fri, 08 Apr 2005 22:48:08 GMT  
 XML/XSLT processors - XSLT4R not working?

Quote:

> I'm looking for a pure Ruby XSLT processor.  Stumbled across XSLT4R.  
> It looks promising, but it doesn't seem to work even for the test.xslt
> in its test directory.  I'd appreciate some recommendations in XSLT
> processor for Ruby.  Is there anything in Ruby similar to JAXP in Java?

I'd suggest trying the libxslt wrapper (listed as 'libxslt' in the RAA).
I haven't tried it in Ruby, but I've used the underlying C library, and
in my experience it is close to 100% conformance with the spec, and its
performance is competitive with MSXML (i.e. it's damn good).

Of course, it does depend on a C library--two, actually, since libxslt
depends on libxml--so it's less portable than a pure Ruby solution. But
it looks like precompiled binaries are now available for Windows as well
as POSIX platforms, so maybe it can be installed without too much agony
on most platforms.

--
Matt Gushee                 When a nation follows the Way,
Englewood, Colorado, USA    Horses bear manure through

http://www.havenrock.com/   When a nation ignores the Way,
                            Horses bear soldiers through
                                its streets.

                            --Lao Tzu (Peter Merel, trans.)



Fri, 08 Apr 2005 23:39:44 GMT  
 XML/XSLT processors - XSLT4R not working?

Quote:
> -----Original Message-----

> Sent: Monday, October 21, 2002 7:48 AM
> To: ruby-talk ML
> Subject: XML/XSLT processors - XSLT4R not working?

> I'm looking for a pure Ruby XSLT processor.  Stumbled across XSLT4R.
> It looks promising, but it doesn't seem to work even for the test.xslt
> in its test directory.  I'd appreciate some recommendations in XSLT
> processor for Ruby.  Is there anything in Ruby similar to JAXP in Java?

Here are some choices for XSLT in Ruby, though they do not fit a "pure Rby"
requirement.
The descriptions are taken from the either the RAA entry or the owner's web
site.

sablot  http://www.rubycolor.org/sablot/
  This is a Ruby interface to Sablotron, the XSLT processor developed by
  Ginger Alliance. Requires Sablotron binary or compiled source

ruby-libxslt  http://www.rubynet.org/modules/xml/ruby-libxslt/
  A working, fully compliant, XSLT engine for Ruby. This module is still under
  heavy development and requires libxml, however it is very functional and is
  feature complete for the XSLT spec. Requires libxml   (binary or compiled from
source)

James

Quote:

> Thanks
> Chris "the XSLT newbie who would rather program in Ruby"



Sat, 09 Apr 2005 00:17:39 GMT  
 XML/XSLT processors - XSLT4R not working?

Is there any known memory leak issues with libxml2, libxslt, salblotron
and expat (which salblotron uses to parse xml)?

I'm curious why there isn't a strong need to create a pure Ruby xslt
processor based on maybe rexml?  Is it because of performance issue?

BTW, ruby-libxml won't link.  I'll notify the owner or submit a patch
later when I have time.

Chris

 >
 >

Quote:
 >>-----Original Message-----

 >>Sent: Monday, October 21, 2002 7:48 AM
 >>To: ruby-talk ML
 >>Subject: XML/XSLT processors - XSLT4R not working?

 >>I'm looking for a pure Ruby XSLT processor.  Stumbled across XSLT4R.
 >>It looks promising, but it doesn't seem to work even for the test.xslt
 >>in its test directory.  I'd appreciate some recommendations in XSLT
 >>processor for Ruby.  Is there anything in Ruby similar to JAXP in Java?

 >Here are some choices for XSLT in Ruby, though they do not fit a "pure
Rby"
 >requirement.
 >The descriptions are taken from the either the RAA entry or the
owner's web
 >site.

 >sablot  http://www.rubycolor.org/sablot/
 >  This is a Ruby interface to Sablotron, the XSLT processor developed by
 >  Ginger Alliance. Requires Sablotron binary or compiled source

 >ruby-libxslt  http://www.rubynet.org/modules/xml/ruby-libxslt/
 >  A working, fully compliant, XSLT engine for Ruby. This module is
still under
 >  heavy development and requires libxml, however it is very functional
and is
 >  feature complete for the XSLT spec. Requires libxml      (binary or
compiled from
 >source)

 >James

 >>Thanks
 >>Chris "the XSLT newbie who would rather program in Ruby"



Sat, 09 Apr 2005 05:21:04 GMT  
 XML/XSLT processors - XSLT4R not working?

Quote:

> I'm looking for a pure Ruby XSLT processor.  Stumbled across XSLT4R.
> It looks promising, but it doesn't seem to work even for the test.xslt
> in its test directory.  I'd appreciate some recommendations in XSLT
> processor for Ruby.  Is there anything in Ruby similar to JAXP in Java?

> Thanks
> Chris "the XSLT newbie who would rather program in Ruby"

BTW, unless there is a special reason you need to use XSLT, you can do quite a
bit of XML transformation using a SAX or stream parser.  If, for example, your
XML maps fairly linearly to your intended output, you can catch events for
particular elements, grab element and attribute values, and write to an output
stream or some variable.  I did this on rubyxml.com, pulling database records as
XML and using the REXML stream parser to convert them into HTML.  It's basically
a template-populating device.

It arguably more efficient than using XSLT, assuming the XSLT processor needs to
read the entire source XML into memory, when transforming large but structurally
simple XML input.

I started out using Ruby and XSLT, but lack of full compliance with the W3C spec
threw me off, and I went and wrote a general-purpose XML-stream template thingy.

I wrote an article called "Stream Parsing with REXML", here:
  http://www.rubyxml.com/articles/REXML/Stream_Parsing_with_REXML

though I've likely changed my actual production code since then (and learned
more abut Ruby as well :] ).

James



Sat, 09 Apr 2005 06:04:31 GMT  
 XML/XSLT processors - XSLT4R not working?

Quote:
> I'm curious why there isn't a strong need to create a pure Ruby xslt
> processor based on maybe rexml?  Is it because of performance issue?

Performance is definitely the issue.  XSLT is a hugely expensive
process can take hours for _very_ large documents and extremely
complex stylesheets even when using strait C libxslt.  On the other
hand, if your documents are simple, XSLT can be nice an snappy.

As a point of reference, libxslt is exceedingly fast for XSLT
processors.  I am currently parsing the RAA xml feed, which is 656KB
in size and am applying a stylesheet to it in 0.346255 seconds using
libxslt.  Hopefully that's fast enough for most folks.  :)

Quote:
> BTW, ruby-libxml won't link.  I'll notify the owner or submit a
> patch later when I have time.

You can find a link to the libxml bindings off of the rubynet.org
site or under:

http://www.rubynet.org/modules/xml/libxslt/

To the real power XML users: variables/parameters are coming soon.

-sc

--
Sean Chittenden



Sun, 10 Apr 2005 12:43:49 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. XSLT Processor comparison on XML.com

2. XSLT processor question

3. XSLT processor

4. Python XSLT Processor?

5. Subject: Re: VPython/Tk app works on single processor but not dual

6. VPython/Tk app works on single processor but not dual

7. Problem with 4Dom xslt processor

8. XML / XSLT problems

9. XML/XSLT for newbies

10. hey all you crazy XML/XSLT developers

11. XML / XSLT / Tcl-Procs

12. xmlarch.py - An XML architectural forms processor written in Python

 

 
Powered by phpBB® Forum Software