[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Parameter/Variable values as attribute values

Subject: Parameter/Variable values as attribute values
From: Zeljko Rajic <Zeljko.Rajic@xxxxxxxxxx>
Date: Tue, 28 Nov 2000 10:46:42 +0100
parameter variable
Hi !

This maybe is some kind of beginners question, but I couldn't find any resource
that tells my how to do it. What I want to do is to assign a parameter or
variable value to an attribute. This is what I currently try to do:

<xsl:stylesheet version="1.0" ...... />

   <xsl:param name="file"/>
   <xsl:variable name="newFile">myFilename</xsl:variable>

   <xsl:template match="/">
      Param: <xsl:value-of select="$file"/>
      Variable: <xsl:value-of select="$newFile"/>
      <saxon:output file="$file" method="xml" version="1.0" encoding="UTF-8"
indent="yes">
         <xsl:copy-of select="."/>
      </saxon:output>
   </xsl:template>

</xsl:stylesheet>


I'm using the Saxon 5.5.1 XSL processor (instant version) and call it like this:

saxon.exe TheSourceDoc.xml Transformer.xsl file=myFilename


The output I get looks like this:

Param: myFilename
Variable: myFilename


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.

As I didn't find any information (neither online nor in any XSL book) on how to
use/access parameter or variable values within tag attributes I hope that
somebody from this list can tell me.

Any help is appreciated!

With best regards,
Zeljko


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.