[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: Florent Georges <darkman_spam@xxxxxxxx>
Date: Mon, 27 Feb 2006 22:48:13 +0100 (CET)
argument variable different
Tracey Zellmann wrote:

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

> The position and id attributes can change, and I can
> handle that as in the earlier case.

> However, the TrackT1 part of the expression can also
> change - to TrackT2, TrackT3, Track5-18, etc, taking on
> various values.

  You have different alternatives:

    <!-- A "global" variable by different case -->
    <xsl:variable name="track.T1" select="/Report/TrackT1"/>
    <xsl:variable name="track.T2" select="/Report/TrackT2"/>
    ...
      <xsl:with-param name="track" select="$track.T1"/>

    <!-- A template by different case -->
    <xsl:template name="...T1">
      ...
    <xsl:template name="...T2">
      ...

    <!-- In last resort... -->
    <xsl:template name="...">
      <xsl:param name="track" as="xs:string"/>
      <xsl:copy-of select="/Report/*[local-name()=$track]/..."/>

  And maybe other...  The choice depends on your particular
needs and contraints.

  Regards,

--drkm




















	

	
		
___________________________________________________________________________ 
Nouveau : tiliphonez moins cher avec Yahoo! Messenger ! Dicouvez les tarifs exceptionnels pour appeler la France et l'international.
Tilichargez sur http://fr.messenger.yahoo.com

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.