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

Re: constructing a "variable" select argument

Subject: Re: constructing a "variable" select argument
From: "Tracey Zellmann" <tracey.zellmann@xxxxxxxxxxx>
Date: Mon, 27 Feb 2006 12:44:11 -0500
constructing a position in argument
Yes..

I can see how that will work. Also cleaner and simpler than my approach.

Thanks for the guidance.

----- Original Message ----- From: "Joern Nettingsmeier" <nettings@xxxxxxxxxxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, February 27, 2006 11:30 AM
Subject: Re: constructing a "variable" select argument



Tracey Zellmann wrote:
I have a stylesheet where I need to handle several different situations.
I want to make these selections, for instance

<xsl:value-of select="$questions//Track[@id='T1']/MCP[@id='MC1']/ReportInstructions"/>
<xsl:value-of select="Report/TrackT1/Position[@position='Left Front']/MCHistogram[@id='1']/Average"/>


<xsl:copy-of select="/Report/TrackT1/Position[@position='Left Front']/MCHistogram[@id='1']/svg:svg"/>


In different situations, the value T1 and MC1 change, to say T2 and MC2, and position might be Right Rear.

how about


<xsl:template name="parameterizedTemplate">
<xsl:param name="trackID"/>
<xsl:param name="mcpID"/>
<xsl:param name="position"/>
<xsl:value-of select="$questions//Track[@id=$trackID]/MCP[@id=$mcpID]/ReportInstructions"/>
<xsl:value-of select="Report/TrackT1/Position[@position=$position]/MCHistogram[@id='1']/Average"/>
</xsl:template>


?

you can invoke this template with

<xsl:call-template name="parameterizedTemplate">
<xsl:with-param name="trackID" select="'T1'"/>
<xsl:with-param name="mcpID" select="'MC2'"/>
<xsl:with-param name="position" select="'Left Rear'"/>
</xsl:call-template>


hope that helps,


jvrn



--
jvrn nettingsmeier

home://germany/45128 essen/lortzingstr. 11/
http://spunk.dnsalias.org
phone://+49/201/491621

if you are a free (as in "free speech") software developer
and you happen to be travelling near my home, drop me a line
and come round for a free (as in "free beer") beer. :-D

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.