This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Parameter/Variable values as attribute values


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]