[xsl] Problems passing parameters

Subject: [xsl] Problems passing parameters
From: "Tibbetts, Jeffery A. NGIC" <frtibja@xxxxxxxxxxxxx>
Date: Fri, 25 Feb 2005 12:58:58 -0500
I am unsuccessfully trying to access the value of a passed parameter.  The
overall effort here is to open a linked document and provide the requisite
path to the linked file to replace links to a generic http://hostname
address with a local path (think of making a cd layout from a set of web
documents based on an RSS feed).

This is the relevant part of the stylesheet code.  I seem to be able to
access the value of the passed parameter with a value-of select statement,
but as soon as I nest the call to the parameter inside a choose/when
statement I get an empty string.  It seems to me the passed parameter is
supposed to be in context throughout the template, so I am unsure of why I
can access it in one manner but not another.

If there is another manner of accessing this information from the file
itself without passing it as a parameter I am open to suggestions.  Thus far
I have not been able to find another way.  Please help.

<xsl:template match="item/link">
<xsl:variable name="test" select="../link/text()"/>
<xsl:variable name=initial select="concat('/home_directory',
(substring-after($test, 'http://www.hostname')))"
<xsl:for-each select="document($initial)/>
<xsl:document href="{concat($inital,'l')}" method="html"
encoding="ISO-8859-1" omit-xml-declaration="no">
<xsl:apply-templates mode="internal_url">
<xsl:with-param name="initial" select=$initial/>

<xsl:template match="@*|node()" mode="internal_url">
<xsl:with-param name="initial">
<xsl:when test="string-length(@href)='19' and contains(@href,
		<xsl:when test=contains($initial, '/')>
			<!--nested choose statements until I get to 8 levels
of depth -not repeated here - -->
		<xsl:variable name="level" select=concat('./', 'index.htm')
		<a href={concat('./','index.htm')><xsl:apply-templates
<xsl:apply-templates select="@*|node() mode="internal_url"/>

Jeffrey A. Tibbetts
Markup Language Specialist
National Ground Intelligence Center

Current Thread