This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Re: Passing Variables to XSL Templates


cutlass (Jim Fuller) wrote:

> use <xsl:param/> but it will depend on what is parsing the xml/xslt
> 
> if u are using M$ then go to www.netcrucible.com and www.bayes.co.uk to get
> the dope on how to do it.

MSXML3 and 4 SDK documentation is not secret -- this is described there.

> other parsers usually will let you define params within the command line
> form,

msxsl.exe is the command-line utility for MSXML -- version 3 and above.

It supports passing parameters on the command line:

L:\>msxsl /?
Microsoft (R) XSLT Processor Version 4.0

Usage: MSXSL source stylesheet [options] [param=value...] [xmlns:prefix=uri...]

Options:
    -?            Show this message
    -o filename   Write output to named file
    -m startMode  Start the transform in this mode
    -xw           Strip non-significant whitespace from source and stylesheet
    -xe           Do not resolve external definitions during parse phase
    -v            Validate documents during parse phase
    -t            Show load and transformation timings
    -             Dash used as source argument loads XML from stdin
    -             Dash used as stylesheet argument loads XSL from stdin



Passing a node-set as parameter in MSXML is most easily accomplished using
IXSLProcessor.addParameter.

Another way to do this is prior to performing the transformation to locate in the
loaded stylesheet the xsl:param or xsl:variable in question using selectSingleNode()
and then to modify (via setAttribute()) its "select" attribute to the value of an
XPath expression, which will evaluate to the necessary node-set.

> and maybe http://www.dpawson.co.uk/xsl/sect2/N5982.html this will help also,
> once you have got the param into your stylesheet.

The above is not described in http://www.dpawson.co.uk/xsl/sect2/N5982.html

Cheers,
Dimitre Novatchev.

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]