[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: using xsl:with-param in apply-templates problem
Please see the code: <xsl:template match="//file"> you never need to start a match pattern with // match="file" will do here (and is the same, apart from default priority) <xsl:variable select="@name" name="filename"/> This variable doesn't seem to be doing ,uch, you could just use @name instead of $filename below. <xsl:apply-templates select="document($filename)" mode="file"> This is OK but beware that it applies templates to the root node (/) of the new document so you need a template in the mode "file" that matches / <xsl:with-param name="filename"><xsl:value-of select="$filename"/></xsl:with-param> Simpler and more efficient to make the parameter a string (or actually in this case, attribute node) rather than a result tree fragment: <xsl:with-param name="filename" select="$filename"/> </xsl:apply-templates> </xsl:template> For some reason the parameter is not being picked up, has anybody got any ideas why? almost certainly because you haven't a template for / in the mode file. A simpler alternative is to apply templates to the top level element rather than the document node, ie <xsl:apply-templates select="document($filename)/*" mode="file"> David _____________________________________________________________________ This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Scanning Service. For further information visit http://www.star.net.uk/stats.asp or alternatively call Star Internet for details on the Virus Scanning Service. 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
|