xsl-list
[Top] [All Lists]

Re: parameters in XSLT 2.0

2005-06-07 21:30:07


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(_at_)gmai        To:     
XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com                                
   
                    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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--






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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--