|
[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
Re: passing parameter to template with using document(
Subject: Re: passing parameter to template with using document()
From: Rick Taylor <taylor@xxxxxxxx>
Date: Wed, 02 Jul 2003 15:29:11 -0600
|
Select only the node(s) you want and avoid using the parameter:
<xsl:for-each select="tech">
<xsl:variable name="current-tech" select="@descr"/>
<xsl:apply-templates
select="document('report.xml')//item[metadata/technology=$current-tech]"
mode="report">
</xsl:apply-templates>
</xsl:for-each>
or
<xsl:for-each select="tech">
<xsl:apply-templates
select="document('report.xml')//item[metadata/technology=current()/@descr]"
mode="report"/>
</xsl:for-each>
<xsl:template match="item" mode="report">
<xsl:value-of select="content/company"/><br/>
</xsl:template>
-rick
At 04:34 PM 7/2/03 -0400, you wrote:
Hi all,
I am having a problem with passing a paramter to template. It works
without using document(). Do you know how to code it working with using
document()?
This is code which has no value pass into template. Anything I am doing
wrong? Thanks!
<xsl:for-each select="tech">
<xsl:variable name="current-tech" select="@descr"/>
<xsl:apply-templates select="document('report.xml')" mode="report">
<xsl:with-param name="current" select="$current-tech"/>
</xsl:apply-templates>
</xsl:for-each>
<xsl:template match="item" mode="report">
<xsl:param name="current" />
<xsl:if test="($current = metadata/technology)">
<xsl:value-of select="content/company/." /><br/>
</xsl:if>
</xsl:template>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Rick Taylor
XML Developer
PPDM Association
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list

|
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
| RSS 2.0 |
|
| Atom 0.3 |
|
|