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

with-param and context

Subject: with-param and context
From: Norman Walsh <ndw@xxxxxxxxxx>
Date: 28 Nov 2000 12:06:17 -0500
with-param and context
If you apply the following stylesheet to a document that consists
simply of "<doc/>", you'll get:

text-only=0
text-only=1

(This is the consistent behavior of Saxon, xalan, and XT.)

I can't fathom what the difference in context makes to
with-param. Enlightenment, please.

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

<xsl:template match="*" mode="title.ref">
  <xsl:param name="text-only" select="'0'"/>

  <xsl:message>text-only=<xsl:value-of select="$text-only"/></xsl:message>
</xsl:template>

<!-- ==================================================================== -->

<xsl:template name="head.content">
  <xsl:param name="node" select="."/>

  <xsl:apply-templates select="$node" mode="title.ref">
    <xsl:with-param name="text-only" select="'1'"/>
  </xsl:apply-templates>
</xsl:template>

<!-- ==================================================================== -->

<xsl:template match="/">
  <xsl:call-template name="head.content">
    <xsl:with-param name="node" select="."/>
  </xsl:call-template>
  <xsl:apply-templates/>
</xsl:template>

<xsl:template match="doc">
  <xsl:call-template name="head.content">
    <xsl:with-param name="node" select="."/>
  </xsl:call-template>
</xsl:template>

</xsl:stylesheet>

                                        Be seeing you,
                                          norm

-- 
Norman.Walsh@xxxxxxxxxxxx | Are you not the future of all the memories
XML Technology Center     | stored within you? The future of the
Sun Microsystems, Inc.    | past?--Val\'ery


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.