Re: Formal parameters for stylesheets

Subject: Re: Formal parameters for stylesheets
From: Jason Diamond <sendangels@xxxxxxx>
Date: Tue, 02 Feb 1999 23:01:20 -0800
Why not something similiar to the xsl:constant element? I assumed from the spec
that the following would be replaced by the constant value:

<xsl:value-of select="{constant(foo)}"/>

But XT complains about an illegal token. The constant function does work as an
attribute value template, though. Is this correct?

A processor could actually support parameters without changing the spec. If a
user did something like this on the command line:

xt -Dfoo=bar test.xml test.xsl

The processor could interpret that as inserting a:

<xsl:constant name="foo" value="bar"/>

into the stylesheet. Maybe a {parameter(foo)} function would actually help so
that users don't confuse the two concepts, though.

Jason Diamond

"Borden, Jonathan" wrote:

> I second both these 'requirements'.
> Perhaps the XSL parameters could be via a PI? e.g.
> <?xml-stylesheet-parameters a="b" c="d" ?>
> >
> >
> > Getting a couple of things off of my chest:
> >
> > --
> >
> > XSL stylesheets should be able to take formal parameters that control
> > their behavior. Those parameters could be specified on the command line,
> > in a browse dialog or in the stylesheet association link/processing
> > instruction.
> >
> > DSSSL specifications almost always take formal parameters but the hacks
> > that people have invented to allow them are all gross. People do
> > things like automatically generating stylesheet bits, changing their
> > document instance and so forth. That's ingenuity but it isn't what we
> > should be forced to do.
> >
> > The only one that is not gross is overriding the value of a variable from
> > outside. The problem with that mechanism is that there is no way that a
> > GUI or command line tool can know which variables are supposed to be
> > overriden and which ones are not. They just must "trust the user." It also
> > means that a GUI cannot *prompt* for the appropriate paramaters.
> >
> > ---
> >
> > Let me also point out that it is absolutely vital that XSL be able to work
> > with a hyperlinked web of document trees. One document at a time is NOT
> > good enough by any stretch of the imagination. (similar hacks must be
> > divised to work around this limitation in transformation languages that
> > exhibit it)
> >
> >
> Jonathan Borden
>  XSL-List info and archive:

 XSL-List info and archive:

Current Thread