Bill Walton wrote:
What more info do you need ? (Honestly asked btw)
I always presume goodwill
good way to be, a very good way, sometimes painful, but, *smiles* good show
Well, from the completely cursory glance given to it, it appears to be a front end to libxslt.
And on libxml. Are either / both of these included in Ruby or Rails? If so, which one?
If you mean are 'libxml' or 'libxslt' included in RoR, then no. These are linux libraries. If you mean the 'ruby wrappers' (ruby-xml) come as 'standard', then no, however, there is a way to have rails generate out xml by using a .rxml file. Have a look around http://wiki.rubyonrails.org/rails/pages/HowtoGenerateXml
Have your ruby program 'open' the xml source file, open the xslt, apply the xslt (using the serve function here) and then print out the output.
I'm already wondering about the 'print out the output' part. As a test, I took a sample XML file and embedded the reference to the XSL file in it ( adding <?xml-stylesheet type="text/xsl" href="stylesheets\ccr_xslt\ccr_20060328.xsl"?> as the second line of the file). Both FF and IE6 support this level of XSLT natively and opening the XML file with either browser renders a correctly styled HTML page.
OTOH, when I do a 'render :file => "same XML file"' via my Rails controller, the page renders but does not have the XSL applied. If I do the render :file on the translated HTML file, it renders that OK. I don't understand this and it worries me a little. Based on the browsers' behavior when I open the file through the File menu, it seems like this ought to work via the render :file if Rails just passed the XML file through to the browser. Any thoughts / ideas on what might be going on here and/or how to fix it would be greatly appreciated!
Well, now, this is the interesting part Ideally, there should be a sort of ':after_filter' on the method that you use to generate the XML. Inside the :after_filter, you would load the stylesheet in much the same way that the ruby-xsl shows. This way, your still using rails and you have set the 'filter' to perform after the generation (so in the future, if someone needs the un-translated XML, then can get it). The header content-type would be different, but, you could probably change that without too much trouble in the :after_filter ..
Thats my thinking. I am unsure if IE/FF include libxslt in there by default, but, leaving this to the individual browser to deal with is dangerous at best. Mean to say, your assuming that all XSLT engines will follow 'the standard', whereas if you do the transformation yourself, at least you know that the -exact- -same- structure of results is sent to all clients.
Hopefully this makes sense, and I am interested in the solution you go with. If its sufficiently 'weird', this could be a great problem to distrac... urm.. occupy my work time tomorrow
Regards as always