Subject: [xsl] Using parameter in for-each select - newbie question From: "Chris Theisen" <cjtheisen@xxxxxxxxx> Date: Thu, 22 Mar 2001 22:07:16 -0500 |
I'm trying to use a parameter in a for-each, but I get the error: D:\TMP>xt vndtst.xml junk.xsl partst.csv table=vd_mstr file:/D:/TMP/junk.xsl:13: expected node test Here's the beginning: <?xml version="1.0" encoding="iso-8859-1"?> <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xt="http://www.jclark.com/xt" extension-element-prefixes="xt"> <xsl:output method="text"/> <xsl:param name="table">default</xsl:param> <xsl:template match="/"> <xsl:for-each select="//$table"> <xsl:call-template name="create-csv"/> </xsl:for-each> </xsl:template> <!--match="/"--> I can change this to use choose, and hardcode all the table references: . . . <xsl:param name="table">default</xsl:param> <xsl:template match="/"> <xsl:choose> <xsl:when test="$table = 'vd_mstr'"> <xsl:for-each select="//vd_mstr"> <xsl:call-template name="create-csv"/> </xsl:for-each> </xsl:when> <xsl:when test="$table = 'ad_mstr'"> <xsl:for-each select="//ad_mstr"> <xsl:call-template name="create-csv"/> </xsl:for-each> </xsl:when> <xsl:otherwise> </xsl:otherwise> </xsl:choose> </xsl:template> <!--match="/"--> Any ideas why the first version won't work? Thanks Chris Theisen cjtheisen@xxxxxxxxx 1-313-277-2441 (Office) 1-734-502-8884 (Mobile) 1-978-428-6174 (eFax) _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Is there a direct phrase , Robert C. Lyons | Thread | Re: [xsl] Using parameter in for-ea, Jeni Tennison |
Re: [xsl] XSL-loop, Larry Garfield | Date | Re: [xsl] XSLT-hosting, Bill Humphries |
Month |