This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
with-param and context
- To: xsl-list at mulberrytech dot com
- Subject: with-param and context
- From: Norman Walsh <ndw at nwalsh dot com>
- Date: 28 Nov 2000 12:06:17 -0500
- Reply-To: xsl-list at mulberrytech dot com
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@East.Sun.COM | 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