This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Parameter/Variable values as attribute values
- To: Zeljko Rajic <Zeljko dot Rajic at brokat dot com>
- Subject: Re: Parameter/Variable values as attribute values
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Tue, 28 Nov 2000 14:13:19 +0000
- CC: xsl-list at mulberrytech dot com
- Organization: Jeni Tennison Consulting Ltd
- References: <3A237F02.C853605@brokat.com>
- Reply-To: xsl-list at mulberrytech dot com
Zeljko,
> <saxon:output file="$file" method="xml" version="1.0" encoding="UTF-8"
indent="yes">>
[snip]
> So it seems the parameter has been passed correctly. But unfortunately the
> parameter nor variable is evaluated within the attribut of the <saxon:output>
> tag, thus a file with the name "$file" is created which contains the copy of the
> original document.
The 'file' attribute of saxon:output is an attribute value template,
which means that if you want it to evaluate an expression to give the
name of the file (as you do here), then you have to put the bit that
you want evaluated between curly brackets ({}s). Try:
<saxon:output file="{$file}" method="xml" version="1.0"
encoding="UTF-8" indent="yes">
instead. This has the advantage that you can append the extension to
the filename (for example) without making the variable take that
value. For example:
<saxon:output file="{$file}.xml" method="xml" version="1.0"
encoding="UTF-8" indent="yes">
would create a file called myFilename.xml.
I hope that helps,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list