You must pass the name of the file as a command-line parameter. The format for
this varies with the XSLT processor you are using. Inside your XSL stylesheet
you will put <xsl:param name="source-file" />. When the processor loads the
stylesheet it will assign the command-line value for the "source-file"
parameter to a variable which you will refer to as "$source-file". By setting
the output type to "text/html", you will be able to output a META element:
<META http-equiv="Content-Type" content="$source-file">
In order to vary the file name automatically with each invocation of the
transformer, you will have to wrap the transformer in a batch (for
Windows-based transforms) or shell script (for Linux, Unix, etc.) and pass the
data file name as a parameter to the script file.
As I have heard it said, "Adding another level of indirection solves almost
every programming problem."
--
Charles Knell
cknell(_at_)onebox(_dot_)com - email
-----Original Message-----
From: "Da Costa Martins, Iolanda Maria
(Iolanda)"<dacostamartins(_at_)agere(_dot_)com>
Sent: Tue, 24 Jun 2003 07:52:56 -0400
To: "'XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com'"
<XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com>
Subject: [xsl] xml (source) file name in html (output format) meta tag
Hi,
I am currently developing a style sheet that works with PegHelp (Windows CE)
in mobile devices...
Due to the specific requirements of PegHelp, I need to output the following
section in the beginning of the file:
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META http-equiv="Content-Type" content="{filename}.html">
<META name="SUBJECT" content="system">
<TITLE>TheTitle</TITLE>
</HEAD>
Where {filename} is a value that must match the actual file name of the XML
file that is being processed to HTML output.
For the transformation process I am using XSLT.
Do you know how could I get this value automatically (at run time of the
transformatio of each xml file) written to the meta tag of the html file?
Thanks
da Costa Martins, Iolanda
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list