|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Parameter/Variable values as attribute values
Hi,
try to use
<saxon:output file="{$file}" method="xml" version="1.0" encoding="UTF-8"
indent="yes">
instead of
<saxon:output file="$file" method="xml" version="1.0" encoding="UTF-8"
indent="yes">
bye,
Robert
----- Original Message -----
From: "Zeljko Rajic" <Zeljko.Rajic@xxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxx>
Sent: Tuesday, November 28, 2000 10:46 AM
Subject: Parameter/Variable values as attribute values
> 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
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








