I was hoping to avoid having to explicitly set a separate variable and
just get it from the input file that's already specified there as the
second argument in the command line... in some languages the command
line parameters are stored and accessible during processing -- you can
use for example arg[1] and arg[2] to retrieve the first and second
command line parameters. I'm guessing that the intervening layer of the
XSL processor (Saxon or whatever) must prevent that from happening in
XSL?
Michele
>>> [log in to unmask] 2/15/2007 2:05:03 PM >>>
You could do it using parameters:
Add <xsl:param name="filename"/> to the top of your stylesheet
Access the value of the parameter with: <xsl:value-of
select="$filename"/>
Add a 'filename' parameter to the commandline:
saxon -o testdata/out_file.htm ../xml_files/in_file.xml
../styles/test.xsl filename=in_file.xml
-----Original Message-----
From: Encoded Archival Description List [mailto:[log in to unmask]]On Behalf
Of
Michele Combs
Sent: 15 February 2007 18:43
To: [log in to unmask]
Subject: Getting name of input file
Anyone know how to access the name of the input file when doing an
XSLT
transform? I'm using Saxon, command line as follows:
saxon -o testdata/out_file.htm ../xml_files/in_file.xml
../styles/test.xsl
Within my style sheet (test.xsl) I want to be able to get the name of
the input file, in this case in_file.xml, and output it at a
particular
spot in out_file.htm. There's got to be a way but I can't seem to
find
it.
Michele C.
-=--=--=--=--=--=--=--=--=--=--=--=--=--=-
Michele R. Combs
[log in to unmask]
Manuscripts Processor
Special Collections Research Center
Syracuse University Library
222 Waverly Avenue
Syracuse, NY 13244
(315) 443-2697
-=--=--=--=--=--=--=--=--=--=--=--=--=--=-
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
Please don't print this e-mail unless you really need to.
---------------------------------------------------------------------------------
National Archives Disclaimer
This email message (and attachments) may contain information that is
confidential to The National Archives. If you are not the intended
recipient you cannot use, distribute or copy the message or attachments.
In such a case, please notify the sender by return email immediately
and erase all copies of the message and attachments. Opinions,
conclusions and other information in this message and attachments that
do not relate to the official business of The National Archives are
neither given nor endorsed by it.
------------------------------------------------------------------------------------
|