Subject: Re: Problem using document function in a template rule while combining two XML files?
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Fri, 31 Oct 2003 10:16:02 +0100
|
> (Test.xsl)
[snip]
> <xsl:template match="students">
> <xsl:for-each select="student">
> <xsl:value-of select="name" /> 
> <xsl:value-of select="age" /><br/>
> <xsl:apply-templates
> select="$DOC2/students/student/qualification" />
> </xsl:for-each>
> </xsl:template>
>
> <!-- MSXML throws error at following point that it does not
> allow variables at this position.
> Even if I make use of document function directly instead of
> taking a variable, it still throws an error.
> -->
> <xsl:template match="$DOC2/students/student/qualification">
> <span>NAREN</span>
> </xsl:template>
> </xsl:stylesheet>
The match pattern of the last template above needn't be so complex at all,
it can be just:
match="qualification"
The template will be instantiated exactly on the necessary nodes, because of
this instruction in your code:
> <xsl:apply-templates
> select="$DOC2/students/student/qualification" />
=====
Cheers,
Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|
Dimitre Novatchev - Fri, 31 Oct 2003 03:59:42 -0500 (EST) <=
Michael Kay - Fri, 31 Oct 2003 05:55:23 -0500 (EST)
|
|