Subject: Re: Parameter/Variable values as attribute values From: "Robert Herschke" <robert@xxxxxxxxxxx> Date: Tue, 28 Nov 2000 15:41:50 +0100 |
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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: Parameter/Variable values as at, Jeni Tennison | Thread | RE: Parameter/Variable values as at, Kay Michael |
Re: how to implement different xsl , Jeni Tennison | Date | Re: doctype, Jeni Tennison |
Month |