Re: Parameter/Variable values as attribute values

Subject: Re: Parameter/Variable values as attribute values
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Tue, 28 Nov 2000 14:13:19 +0000

>       <saxon:output file="$file" method="xml" version="1.0" encoding="UTF-8"
> 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 Tennison

 XSL-List info and archive:

Current Thread