Re: [xsl] Change an XSLT top-level parameter

Subject: Re: [xsl] Change an XSLT top-level parameter
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 9 Nov 2001 09:49:18 GMT
> I was hoping for something like ...

ah well in that case you don't mind editing the file to add the parameter
(which was really what I was asking) so in that case what I do is invent
myself a new namespace (say mailto:Robert.Stuart@xxxxxxxxxxxxxxxxx) and
in the doument go

<?xml-stylesheet type="text/xsl" href="stylesheet.xsl"?>
<top-level-element
  normal-attribute1="x"
  normal-attribute2="y"
  xmlns:param="Robert.Stuart@xxxxxxxxxxxxxxxxx"
  param:p1="val1"
  param:p2="val2"
>

and in the stylesheet have param: bound to the same namespace and


<xsl:param name="p1" select="/*/@param:p1"/>
<xsl:param name="p2" select="/*/@param:p2"/>


'course if you areu sing a dtd and want to remain valid you need to add the
namespaced attributes to the dtd, if using a schema language it might
not matter as you can arrange to allow anny attributes from your
"foreign" namespaec into your instance doc.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread