[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Re: Passing Variables to XSL Templates

Subject: Re: Re: Passing Variables to XSL Templates
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Wed, 27 Jun 2001 05:35:18 -0700 (PDT)
msxsl startmode
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.