Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 9th, 2007, 04:26 AM
Authorized User
 
Join Date: Jan 2006
Location: tel aviv, israel, Israel.
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default element parameter

I would like to know if I can set left-y-axis to be a parameter that sent to the function and according to the parameter that sent, to choose which to be?

input:


            <left-y-axis>
                <xsl:attribute name="display">
                    <xsl:value-of select= "$display"/>
                </xsl:attribute>
                <columns>
                    <xsl:variable name="start" select="(position()-1)*4 + 1"/>
                    <xsl:for-each select = "$counter-db_columns[@class='statistic'][position() &gt;= $start and position() &lt; $start+4]">
                        <column showNAIfNullValues="true" showZeroIfZeroValues="true" >
                            <xsl:call-template name="general-attribute-parameters">
                                <xsl:with-param name="key" select="@dbcolumn"/>
                                <xsl:with-param name="display" select="concat($tech_id, '-', @dbcolumn)"/>
                            </xsl:call-template>
                        </column>
                    </xsl:for-each>
                </columns>
            </left-y-axis>

output:

left-y-axis to recieve as a parameter and to be left-y-axis1 or left-y-axis2 (depend on the parameter that I will send from the method)

 
Old September 9th, 2007, 06:11 AM
Authorized User
 
Join Date: Jan 2006
Location: tel aviv, israel, Israel.
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I will try to be more specific, is there a way to an attribute title to be sent as a parameter in XSL?

 
Old September 9th, 2007, 06:21 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

You can have global parameters that are xsl:param elements as top level children of the stylesheet. These are set by the application before the transform takes place. How you do this depends on the processor you are using.

--

Joe (Microsoft MVP - XML)
 
Old September 9th, 2007, 07:03 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Replace <left-y-axis> by <xsl:element name="{$param}">

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference




Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem adding element to the previous element dani1 XSLT 5 September 10th, 2008 01:38 AM
Parameter object malfunction - out parameter dash dev C# 2005 6 December 4th, 2007 12:58 PM
translate element name to element name lexzeus XSLT 3 September 4th, 2006 09:04 AM
Can I tell what element I am currently in? insanek XSLT 4 September 19th, 2005 05:44 AM
adding of element and assigning to one element sushovandatta XSLT 2 November 16th, 2004 07:04 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.