Subject: Re: [xsl] dynamic variable name/implementation question From: JBryant@xxxxxxxxx Date: Thu, 25 Aug 2005 13:34:41 -0500 |
Hi, Ed, One way to do that is to write a stylesheet that writes a stylesheet. The first stylesheet reads the XML file and determines the names of the parameters. Then it writes a second stylesheet that has the necessary parameter declarations. Then you run the second stylesheet to get your output. Jay Bryant Bryant Communication Services (presently consulting at Synergistic Solution Technologies) Ed S <lists@xxxxxxxxxxxxxxxxxxxxx> 08/25/2005 01:17 PM Please respond to xsl-list@xxxxxxxxxxxxxxxxxxxxxx To xsl-list@xxxxxxxxxxxxxxxxxxxxxx cc Subject [xsl] dynamic variable name/implementation question Hi- I'm trying to find a workaround or alternate implementation for a particular problem I'm tring to solve. I have various parameters that are passed into the processor, and I would like to use their values in the stylesheet. However, I've found that XSLT 1.0 does not support dynamic variables. I would like to do the following: XML: ... <text-block> this is some text. Folowing is dynamic- <external-value parameter="someParam"/> -preceding was dynamic </text-block> ... XSL: ... <xsl:template match="external-vaue"> <xsl:value-of select="$@parameter"/> <!-- this won't work --> </xsl:template> ... where there is a parameter "someParam" passed into the stylesheet - say someParam="foo". My output would be: ... this is some text. Folowing is dynamic- foo -preceding was dynamic ... Has anybody else ever needed this fuctionality?
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] dynamic variable name/impleme, Ed S | Thread | RE: [xsl] dynamic variable name/imp, Michael Kay |
[xsl] dynamic variable name/impleme, Ed S | Date | RE: [xsl] dynamic variable name/imp, Michael Kay |
Month |