M. David Peterson wrote:
On Thu, 13 Sep 2007 16:16:55 -0600, Michael Kay <mike(_at_)saxonica(_dot_)com>
wrote:
http://developer.mozilla.org/en/docs/XSLT:PI_Parameters
But these are separate PI's. And to be quite honest, I've never
understood the justification of the xslt-param PI. What does,
<?xslt-param name="size" select="2"?>
... buy me that I can't get with,
<xsl:param name="size" select="/foo/param/size"/>
, the second of which is cross-browser compatible?
At anytime when a browser invents a new thing, it is not cross browser
compatible. Nobody uses XHR in the early days: too complex was the
comment. Now it is one the hottest new technologies (opinion vary).
Ok, this is not so much of a new hot technology. It is a minor feature.
But we are talking about inclusion through parameters. It is a
convenience method. You have your xsl:param inside your XSLT file which
is easier to address then something like
document('$current-url')/my:param and declare the necessary
extension-element-prefixes.
Depending on your server side environment, it is likely that you have
one source for XML. This way you do not need to change this XML and you
can still add metadata through parameters.
But of course, the whole design concept around PI / XSLT is kind a bad.
It is sometimes (very sometimes) convenient to test the layout of your
transformation in a browser. And if you are accustomed to XML spy you
probably use it more often (because it does so for you).
If a server file looks like this SSI file (probably won't compile, but
you get the idea)
<?xslt-param name="date" value="<!--#echo var='DATE_LOCAL' -->"?>
<?xslt-param name="ip" value="<!--#echo var='IP_REFERER' -->"?>
<?xml-stylesheet mystylesheet.xslt ?>
<!--#include file="some-generated-xml-file.xml" -->
In this scenario it is unlikely that it is handy to change the xml info
on-the-fly, because that means re-parsing in a system where you already
include it via some SSI call. In that use case, it can be handy to
simply extend your SSI file with some dynamic parameters, or a CGI
inclusion.
But all this is, indeed, fairly useless unless other browsers implement
this too.
Cheers,
-- Abel Braaksma
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--