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

Re: passing a sequence as a parameter

Subject: Re: passing a sequence as a parameter
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 26 Feb 2008 16:24:43 GMT
Re:  passing a sequence as a parameter
>  Could you please demonstrate this with an example (i.e. passing a
> document node as a parameter to the stylesheet).

actually on the command line you pass a ducument file or URI but it gets
passed in as a document node after being parsed.


saxon9
No source file name
Saxon 9.0.0.2J from Saxonica
Usage: see http://www.saxonica.com/documentation/using-xsl/commandline.html
Options: 
  -a                    Use xml-stylesheet PI, not style-doc argument
  -c:filename           Use compiled stylesheet from file
  -cr:classname         Use collection URI resolver class
  -dtd:on|off           Validate using DTD
  -expand:on|off        Expand defaults defined in schema/DTD
  -explain[:filename]   Display compiled expression tree
  -ext:on|off           Allow|Disallow external Java functions
  -im:modename          Initial mode
  -it:template          Initial template
  -l:on|off             Line numbering for source document
  -m:classname          Use message receiver class
  -o:filename           Output file or directory
  -or:classname         Use OutputURIResolver class
  -outval:recover|fatal Handling of validation errors on result document
  -p:on|off             Recognize URI query parameters
  -r:classname          Use URIResolver class
  -repeat:N             Repeat N times for performance measurement
  -s:filename           Initial source document
  -sa                   Schema-aware transformation
  -strip:all|none|ignorable      Strip whitespace text nodes
  -t                    Display version and timing information
  -T[:classname]        Use TraceListener class
  -TJ                   Trace calls to external Java functions
  -tree:tiny|linked     Select tree model
  -u                    Names are URLs not filenames
  -val:strict|lax       Validate using schema
  -versionmsg:on|off    Warn when using XSLT 1.0 stylesheet
  -warnings:silent|recover|fatal  Handling of recoverable errors
  -x:classname          Use specified SAX parser for source file
  -xi:on|off            Expand XInclude on all documents
  -xmlversion:1.0|1.1   Version of XML to be handled
  -xsl:filename         Stylesheet file
  -y:classname          Use specified SAX parser for stylesheet
  -?                    Display this message 
  param=value           Set stylesheet string parameter
  +param=filename       Set stylesheet document parameter
  !option=value         Set serialization option


see the last but one line...


so you go 

saxon9  it=main style.xsl +doc1=file1.xml +doc2=file2.xml

where style.xsl has

<xsl:stylesheet...

<xsl:param name="doc1"/>
<xsl:param name="doc2"/>


<xsl:template name="main">
  <xsl:value-of select="$doc1/a/b/c"/>
  <xsl:value-of select="$doc2/a/b/c"/>
...

(saxon 8 and I think 7 had same feature but not saxon6 as far as I recall)


David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

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-2011 All Rights Reserved.