Re: [xsl] parameters in XSLT 2.0

Subject: Re: [xsl] parameters in XSLT 2.0
From: omprakash.v@xxxxxxxxxxxxx
Date: Wed, 8 Jun 2005 10:00:07 +0530
Hi Bruce,
    See the below XSL file and it may become clear why tunnel parameters is
a welcome feature.


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl
="http://www.w3.org/1999/XSL/Transform";>

<xsl:strip-space elements="*"/>

<xsl:param name="clicknode"/>


<xsl:output method="xml" indent="yes" />

   <xsl:template match="/">

     <xsl:variable name="rootnode" select="name(.)"/>
     <xsl:apply-templates select="@*|node()">
          <xsl:with-param name="rootnode" select="$rootnode"/>
     </xsl:apply-templates>

   </xsl:template>

     <xsl:template match="@*|node()">
     <xsl:param name="rootnode"/>

     <xsl:apply-templates select="@*|node()"/>

   </xsl:template>

    <xsl:template match="node()[local-name() = 'table']">
<xsl:param name="rootnode"/>

     <xsl:apply-templates>
     <xsl:with-param name="rootnode" select="$rootnode"/>
     </xsl:apply-templates>

    </xsl:template>


    <xsl:template match="node()[local-name() = 'head']">
<xsl:param name="rootnode"/>

     <xsl:apply-templates>
     <xsl:with-param name="rootnode" select="$rootnode"/>
     </xsl:apply-templates>

    </xsl:template>


    <xsl:template match="node()[local-name() = 'html']">
<xsl:param name="rootnode"/>

     <xsl:apply-templates>
     <xsl:with-param name="rootnode" select="$rootnode"/>
     </xsl:apply-templates>

    </xsl:template>


    <xsl:template match="node()[local-name() = 'body']">
<xsl:param name="rootnode"/>

     <xsl:apply-templates>
     <xsl:with-param name="rootnode" select="$rootnode"/>
     </xsl:apply-templates>

    </xsl:template>

    <xsl:template match="node()[local-name() = 'tr']">
<xsl:param name="rootnode"/>

     <xsl:apply-templates>
     <xsl:with-param name="rootnode" select="$rootnode"/>
     </xsl:apply-templates>

    </xsl:template>

<xsl:template match="node()[local-name() = 'td']">
<xsl:param name="rootnode"/>

     <xsl:apply-templates>
     <xsl:with-param name="rootnode" select="$rootnode"/>
     </xsl:apply-templates>

    </xsl:template>

     <xsl:template match="node()[local-name() = 'a']">
     <xsl:param name="rootnode"/>


    </xsl:template>


    <xsl:template match="node()[local-name() = 'p']">
<xsl:param name="rootnode"/>

     <xsl:apply-templates>
     <xsl:with-param name="rootnode" select="$rootnode"/>
    </xsl:apply-templates>


    </xsl:template>


     <xsl:template match="text()">
    </xsl:template>


  <xsl:template match="root">
     <xsl:param name="rootnode"/>

     <xsl:apply-templates>
     <xsl:with-param name="rootnode" select="$rootnode"/>
     </xsl:apply-templates>

    </xsl:template>

  <xsl:template match="node()[local-name() = 'text']">
     <xsl:param name="rootnode"/>

     <xsl:apply-templates>
     <xsl:with-param name="rootnode" select="$rootnode"/>
     </xsl:apply-templates>

    </xsl:template>

  <xsl:template name="footer">
<xsl:param name="rootnode"/>

 </xsl:template>

</xsl:stylesheet>


Cheers,
prakash





                                                                                                                   
                    Bruce D'Arcus                                                                                  
                    <bdarcus@gmai        To:     XSL-List@xxxxxxxxxxxxxxxxxxxxxx                                   
                    l.com>               cc:     (bcc: omprakash.v/Polaris)                                        
                                         Subject:     [xsl] parameters in XSLT 2.0                                 
                    06/07/2005                                                                                     
                    06:31 PM                                                                                       
                    Please                                                                                         
                    respond to                                                                                     
                    xsl-list                                                                                       
                                                                                                                   
                                                                                                                   




I've got a few questions about using parameters in XSLT 2.0:

First, am I right that if I use an "as" attribute of element() or
node() I am passing a reference to the original element or node, and
thus that this is an efficient operation?

Related, am I correct that these below are equivalent from a processing
standpoint?

<xsl:variable name="foo" select="bar" as="element()"/>

<xsl:variable name="foo" as="element()">
   <xsl:sequence select="bar"/>
</xsl:variable>

Finally, in general, under what conditions should one use tunnel
parameters?  I do a lot of parameter passing in my stylesheets, though
the content of those parameters is typically fixed.

Bruce






This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only. 
If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately.
You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification,
distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited.

Visit Us at http://www.polaris.co.in

Current Thread