How to refer to xpath using variables?
[email protected] (Mlavikai)
| Newsgroups | gmane.comp.mozilla.devel.xml |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <[email protected]> |
Hi. I'm bit puzzled. The following example does not work with mozilla. XML-file: ... <include-data xpath="/foo/bar" mode="foo" /> ... XSL-file: ... <xsl:template match="include-data"> <xsl:variable name="xpath"><xsl:value-of select="xpath"></xsl:variable> <xsl:variable name="mode="><xsl:value-of select="mode"></xsl:variable> <xsl:apply-templates select="$xpath" mode="$mode" /> </xsl:template> ... The error message I get is: "Error loading stylesheet: (null)" However, if I remove the mode-attribute, the error message is: "Error during XSLT transformation: An XPath expression was expected to return a NodeSet." What to do?