Re: [xslt] Executing xslt scripts



On 2006-01-26 17:30:22 -0500, Scott Bronson wrote:
> On Thu, 2006-01-26 at 11:00 -0500, Daniel Veillard wrote:
> > On Thu, Jan 26, 2006 at 10:47:33AM -0500, Scott Bronson wrote:
> > >         #!/usr/bin/xsltproc
> > >         <xsl:stylesheet version="1.0"
> > >         ....
> > >         </xsl:stylesheet>
> > 
> >   that's no more XML so that's not XSLt anymore.
> 
> That file is perfectly valid XML with a shebang line at the top.  Since
> a shebang will never, ever appear in well-formed XML anyway, I don't see
> what the issue is.  It doesn't break the spec.  It just allows xsltproc
> to process another type of file.

Then we'll see users asking for PHP support, which is valid XML with
some additional code...

> > > - It makes filters much easier to specify in programs.  Right now, to
> > > specifyiing xslt filters in liferea is a drag.  You need to type
> > > "xsltproc ~/transform.xslt -" -- a 3 arguments.  If tt.xslt were an
> > > executable file, then you could specify it as you do any other filter,
> > > with a standard file dialog.  That's much easier!
> > 
> >   not that much easier, but certainly breaking the spec
> 
> Maybe I didn't explain very well... Liferea allows the user to select a
> transform script using the standard file dialog.  However, because
> xsltproc can't handle scripts marked executable, Liferea must *also*
> inlcude a way for the user to type in a command line.

No, not "must". Liferea does because this is more powerful.
Otherwise you'd just need a (very simple) wrapper.

> For many (most?) Gnome users, selecting a script in a file dialog is
> trivial, typing in a command line is unheard of.  Easier?  It's
> night-and-day easier!

Again, you just need a (very simple) wrapper.

> > > - It would make my life nicer to not have to have to write shell
> > > script to automate simple transforms.
> > 
> >   I don't know why 3 args forces to write a shell script.
> 
> It's not the number of arguments that forces me to write a shell script.
> It's the fact that I can't launch an xslt script simply by specifying
> the file.  If xsltproc would ignore the shebang line, then everything
> would just work.

No, because xsltproc must report errors (and this is what users want
in general, anyway). So, it must be another program, e.g. xsltscript.
Then, see above. But this should never be distributed in standard. If
people started to write XSLT files with the shebang line, this would
break most XML tools.

The only right solution is to have OS support for what you want to do.

-- 
Vincent Lefèvre <vincent vinc17 org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]